Skip to main content
A newer version of this page is available. .

Sorting in Code

Server-Side

To apply sorting to a column(s), use one of the following methods:

The following sample code sorts data against the Budget column in ascending order:


ASPxTreeList1.SortBy((TreeListDataColumn) ASPxTreeList1.Columns["Budget"], DevExpress.Data.ColumnSortOrder.Ascending);

The number of columns involved in sorting is returned by the ASPxTreeList.SortCount property. The column’s position among sorted columns is specified by the TreeListDataColumn.SortIndex property.

To remove sorting, do one of the following:

To clear sorting applied to the ASPxTreeList, use the ASPxTreeList.ClearSort method.

Client-Side

Use the ASPxClientTreeList.SortBy client method to sort data by the values of the specified data column.