
| Type | Description | |||
| SortOrderEnum | A SortOrderEnum expression that indicates the column's sort order. |
The control automatically sorts a column when the user clicks the column's header, if the SortOnClick property is exDefaultSort. If the SortOnClick property is exNoSort, the control disables sorting the items when the user clicks the column's header.
There are two methods to get the items sorted like follows:
Grid1.Columns("Column 1").SortOrder = SortAscending
The SortOrder property adds the sorting icon to the column's header, if the DisplaySortIcon property is True.
Grid1.Items.SortChildren 0, "Column 1", False
The SortType property of the Column object specifies the way how a column gets sorted. By default, a column gets sorted as string.
The following VB sample sorts the first column by dates:
With Grid1
With .Columns(0)
.SortType = SortDate
End With
End With
If you need to sort a column using your special way you may want to use the SortType = SortUserData, or SortType = SortCellData that sorts the column using CellData / CellSortData property for each cell in the column. In this case, the CellData or CellSortData property holds numeric values only.