08-07-2017 4:31 PM - edited 02-04-2024 12:58 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.