SortOrder Property
Description
A collection of GridColumns used to determine how the GridControl is sorted (i.e., first by column A in ascending order, then by column B in descending order, etc.).
Property Type
Read-only property
Syntax (Visual Basic)
Public Property SortOrder() As [GridColumnOrder](XtremeGridControl~GridColumnOrder.md)
Remarks
The order in which the columns are added to the collection of sort columns determines the precedence.
Example
Sorting Columns in the GridControl (Visual Basic)
This sample illustrates how to sort the columns in the GridControl. If you had 8 columns added to the GridControl, this sample would sort the columns first by the column at ItemIndex 7, then by the column at ItemIndex 2, then by the column at ItemIndex 5.
' This code below will add three columns to the SortOrder collection of columns.
' This will cause the columns in the GridControl to first be sorted by column 7,
' which has an index of zero (0) in the SortOrder collection. Columns are first sorted
' in the order that they are added to the SortOrder collection.
wndGridControl.SortOrder.Add wndGridControl.Columns(7)
wndGridControl.SortOrder.Add wndGridControl.Columns(2)
wndGridControl.SortOrder.Add wndGridControl.Columns(5)
' This will cause the column at index 0 of the SortOrder collection to be sorted
' in descending order.
wndGridControl.SortOrder(1).SortAscending = False
See Also
- GridControl Control
- GridColumnOrder Object
- GridColumn Sortable Property
- GridColumn SortAscending Property

Grid Control ActiveX Control v24.0
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.