Back to Devexpress

TreeListControlBase.SortBy(TreeListColumn, ColumnSortOrder, Int32) Method

wpf-devexpress-dot-xpf-dot-grid-dot-treelistcontrolbase-dot-sortby-x28-devexpress-dot-xpf-dot-grid-dot-treelistcolumn-devexpress-dot-data-dot-columnsortorder-system-dot-int32-x29.md

latest3.3 KB
Original Source

TreeListControlBase.SortBy(TreeListColumn, ColumnSortOrder, Int32) Method

Sorts data against the specified column and arranges it according to the sort order. The position of the sort condition within the TreeListSortInfoCollection depends on the sortIndex parameter.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public void SortBy(
    TreeListColumn column,
    ColumnSortOrder sortOrder,
    int sortIndex
)
vb
Public Sub SortBy(
    column As TreeListColumn,
    sortOrder As ColumnSortOrder,
    sortIndex As Integer
)

Parameters

NameTypeDescription
columnTreeListColumn

A column within the TreeListControl.

| | sortOrder | ColumnSortOrder |

Sort order of the specified column.

| | sortIndex | Int32 |

The index of the specified sort condition within the TreeListSortInfoCollection.

|

Remarks

The TreeListControl allows you to sort data against multiple columns. Call the SortBy method to apply a new sort condition. The TreeListControl creates a new GridSortInfo object that stores sort parameters, and appends this object to the TreeListSortInfoCollection. The sort operation result depends on the order of the applied conditions within the collection. If the TreeListSortInfoCollection already contains a sort condition for the specified column, the TreeListControl replaces this condition with a new condition.

If the sortIndex parameter exceeds the index of the last element within the TreeListSortInfoCollection, the TreeListControl appends the GridSortInfo object to the collection. Pass a negative value as the sortIndex parameter to remove the applied sort condition.

Refer to the following topics for more information: Sorting in Code and Sort Nodes.

See Also

TreeListControlBase Class

TreeListControlBase Members

DevExpress.Xpf.Grid Namespace