Multiple Sort
Hi,
Is there a way to set Multiple Sort for the grid ? I see the option available under Behavior in the Grid designer, but am not sure how it applies. Can you please give me an example.
Thanks,
Deepak
0
-
Hi,
In order to set multiple sorting you should sequentially specify the sort direction for the selected columns. Each new property call adds a new level in the sorting. To cancel the sorting, simply call the Header.SortedColumns.Clear() method. You can also use the Header.SortedColumns to iterate columns.
Note, the same approach is used for all other containers like Header.FixedColumns, Header.VisibleColumns, Grid.Selection etc...
grid.Headers[0].SortedColumns.Clear();
grid.Headers[0]["Column1"].SortDirection = SortDirection.Ascending;
grid.Headers[0]["Column2"].SortDirection = SortDirection.Descending;Best regards,
Dapfor
0
Please sign in to leave a comment.
Comments
1 comment