Skip to main content

How to: Sort data

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.

using DevExpress.XtraTreeList.Columns;
//...
treeList1.BeginSort();
treeList1.Columns["Department"].SortOrder = SortOrder.Ascending;
treeList1.Columns["Budget"].SortOrder = SortOrder.Descending;
treeList1.EndSort();