Skip to Content
0

SAP Business One Grid Column Get Sorting Type

Aug 07, 2017 at 03:31 PM

174

avatar image
Former Member

Hi,

I need to get whether grid column is sorted ascending or descending.

I have tried get it from GridSortAfter .

private void Grid0_GridSortAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)

pVal value only shows the column id not sort type.

How can i get the sort type asc or desc?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

ANKIT CHAUHAN
Aug 08, 2017 at 05:50 AM
0

Hi,

As per my knowledge in previous versions, Ordering is done automatically when using grouping for grids. If you want to order 2 columns, you need to use 2 levels of grouping (oGrid.CollapseLevel = 2). This will automatically sort the 2 columns in ascending order. Also, the ordering of grids using the "ORDER BY" statement was a missing functionality in SAP Business One SDK.

Therefore, you can give it a try in latest available version and check whether it helps!

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 08, 2017 at 06:47 AM
0

Thanks Ankit,

But i dont want to order 2 columns.

I only need to know in which column is sorting and what is the sorttype of the column (ascending/ descending).

I can get the info about the valueof the column with GridSortAfter ( "pVal.ColUID" shows me "Banka Adı" column)

yet , by doing this i have no idea about the sortype of the mentioned column?(SAPbouiCOM.BoGridSortType)

How can i get column is sorted "descending".


grid.png (4.4 kB)
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 08, 2017 at 08:50 AM
0

Hi Gul,

Have a look here: https://archive.sap.com/discussions/message/10139064#10139064

One commonly used approach is to check the title for the ordering "symbol". That was the way long ago and since SAP still hasn't provided with a proper "sort direction" property I believe we are still stuck with it.

As for knowing which column, you can use the same approach since only one column can be ordered at any time (using the grid sorting).

Pedro Magueija

LinkedIn | Twitter | Blog

Share
10 |10000 characters needed characters left characters exceeded