Skip to main content
All docs
V25.1
  • TreeListControlBase.SortBy(TreeListColumn, ColumnSortOrder) Method

    Sorts data against the specified column and arranges it according to the sort order.

    Namespace: DevExpress.Xpf.Grid

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

    NuGet Package: DevExpress.Wpf.Grid.Core

    Declaration

    public void SortBy(
        TreeListColumn column,
        ColumnSortOrder sortOrder
    )

    Parameters

    Name Type Description
    column TreeListColumn

    A column within the TreeListControl.

    sortOrder ColumnSortOrder

    Sort order of the specified column.

    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.

    Call the SortBy(TreeListColumn, ColumnSortOrder, Int32) method to specify the sort condition index within the TreeListSortInfoCollection.

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

    See Also