Skip to main content

ASPxTreeList.SortBy(TreeListDataColumn, ColumnSortOrder) Method

Sorts data by the specified column’s values.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public ColumnSortOrder SortBy(
    TreeListDataColumn column,
    ColumnSortOrder sortOrder
)

Parameters

Name Type Description
column TreeListDataColumn

A TreeListDataColumn object that represents the column within the ASPxTreeList.

sortOrder ColumnSortOrder

A ColumnSortOrder enumeration value that specifies the column’s sort order.

Returns

Type Description
ColumnSortOrder

A ColumnSortOrder enumeration value that specifies the column’s sort order.

Remarks

The ASPxTreeList allows data sorting by multiple columns. Any previous sorting is not cleared when calling the SortBy method. The new sort order applies an additional sorting condition to the one previously applied. The newly sorted column is appended to the collection of sorted columns. Its index within the collection can be obtained via its TreeListDataColumn.SortIndex property.

You can also use the overloaded SortBy method that allows the column’s position among sorted columns to be specified.

Sorting is allowed if the TreeListSettingsBehavior.AllowSort property is set to true.

See Also