Use the SortOrder property to specify whether and how nodes are sorted against a column.
C# |
treeList1.Columns["Department"].SortOrder = SortOrder.Ascending;
|
VB |
TreeList1.Columns("Department").SortOrder = SortOrder.Ascending
|
To remove sorting against a column set its SortOrder property to System.Windows.Forms.SortOrder.None. To clear the sort settings for all columns, call the TreeList.ClearSorting method.
The TreeList.BeginSort and TreeList.EndSort methods allow you to avoid superfluous updates when you change sort settings for multiple columns.
Example
The following code sorts data against the Department and Budget columns. The TreeList.BeginSort and TreeList.EndSort methods wrap the code to avoid superfluous updates.
C# |
using DevExpress.XtraTreeList.Columns;
treeList1.BeginSort();
treeList1.Columns["Department"].SortOrder = SortOrder.Ascending;
treeList1.Columns["Budget"].SortOrder = SortOrder.Descending;
treeList1.EndSort();
|
VB |
Imports DevExpress.XtraTreeList.Columns
TreeList1.BeginSort()
TreeList1.Columns("Department").SortOrder = SortOrder.Ascending
TreeList1.Columns("Budget").SortOrder = SortOrder.Descending
TreeList1.EndSort()
|
The SortIndex property specifies the sorted column's position among other sorted columns.
See Sorting for more information.