Back to Devexpress

TreeList.SortedColumnCount Property

windowsforms-devexpress-dot-xtratreelist-dot-treelist-360c7598.md

latest3.1 KB
Original Source

TreeList.SortedColumnCount Property

Gets the number of columns involved in sorting.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[Browsable(false)]
public int SortedColumnCount { get; }
vb
<Browsable(False)>
Public ReadOnly Property SortedColumnCount As Integer

Property Value

TypeDescription
Int32

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

|

Remarks

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.

Example

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

csharp
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
   //...
}
vb
Imports DevExpress.XtraTreeList.Columns
' ...
Dim I As Integer
For I = 0 To TreeList1.SortedColumnCount - 1
   Dim SortedColumn As TreeListColumn = TreeList1.GetSortColumn(I)
   ' perform desired operations on a sorted column here
   '...
Next

See Also

SortOrder

GetSortColumn(Int32)

ClearSorting()

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace