TreeList.SortedColumnCount Property

Gets the number of columns involved in sorting.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v21.1.dll


public int SortedColumnCount { get; }

Property Value

Type Description

An integer value representing the number of columns involved in sorting.


The Tree List control gives you the ability to sort its data by the values of multiple columns. This can be applied by setting the TreeListColumn.SortOrder property of columns to a value that differs from ColumnSortOrder.None. When column sorting is applied, the column is added to the internal sort column list. If column sorting is cancelled, the column is removed from this list.

The SortedColumnCount property returns the number of columns in the sort column list. Individual columns from this list can be obtained via the TreeList.GetSortColumn method call. You can use these two members to traverse through the columns involved in sorting.


The following sample code uses the TreeList.GetSortColumn method and the TreeList.SortedColumnCount property to traverse through columns involved in sorting.

using DevExpress.XtraTreeList.Columns;
// ...
for(int i = 0; i < treeList1.SortedColumnCount; i++) {
   TreeListColumn sortedColumn = treeList1.GetSortColumn(i);
   // perform desired operations on a sorted column here
See Also