Specifies the column's sort order.
Type | Description | |||
SortOrderEnum | A SortOrderEnum expression that indicates the column's sort order. |
The SortOrder property determines the column's sort order. By default, the SortOrder property is SortNone. Use the SortOrder property to sort a column at runtime. Use the SortType property to determine the way how the column is sorted.
The group automatically sorts a column when the user clicks the column's header. If the SortOnClick property is False the group disables sorting the items when user clicks the column's header. There are two methods to get the items sorted like follows:
Using the SortOrder property of the Column object::
Group.Columns(ColIndex).SortOrder = SortAscending
The SortOrder property adds the sorting icon to the column's header, if the DisplaySortIcon property is True.
Using the SortChildren method of the Items collection. The SortChildren sorts the items. The SortChildren method sorts the child items of the given parent item in the group. SortChildren will not recourse through the tree, only the immediate children of the item will be sorted. The following sample sort descending the list of root items on the "Column 1"( if your group displays a list, all items are considered being root items ).
Group.Items.SortChildren 0, "Column 1", False