Skip to main content

Sort Tree List Data 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 client ASPxClientTreeList.SortBy method to sort data by the values of the specified data column.