
| Type | Description | |||
| SortOnClickEnum | A SortOnClickEnum expression that indicates the action that control takes whether the user clicks the column's header. |
Use the SortOnClick property to disable sorting items when the user clicks on the column's header. Use the SortBarVisible property to show the control's sort bar. Use the SingleSort property to allow sorting by single or multiple columns. Use the AllowSort property to avoid sorting a column when user clicks the column. Use the DefaultSortOrder property to specify the column's default sort order, when the user first clicks the column's header. Use the SortChildren method to sort a column, at runtime. Use the DisplaySortIcon property to hide the sort icon if the column is sorted. Use the HeaderVisible property to show or hide the control's header. Use the BackColorHeader property to specify the header's background color. Use the AllowSizing property to disable resizing a column when user clicks the right margin of the column.
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 control fires the Sort event when the control sorts a column ( the user clicks the column's head ) or when the sorting position is changed in the control's sort bar. Use the Sort event to sort the data when the SortOnClk property is exUserSort.