TreeListDataColumn.SortIndex Property
Gets or sets the column’s position among sorted columns.
Namespace: DevExpress.Web.ASPxTreeList
Assembly: DevExpress.Web.ASPxTreeList.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Default | Description |
---|---|---|
Int32 | -1 | An integer value that specifies the zero-based column’s index among sorted columns. -1 if data is not sorted by this column. |
Remarks
The ASPxTreeList allows data sorting by multiple columns. Once a column is sorted, it is automatically added to the collection of sorted columns. If no columns were previously sorted, the column becomes the only element in the collection and gets the 0 sort index. If sorting by one more columns, the newly sorted column is appended to the collection and gets the 1 index, etc.
When data is sorted by multiple columns, you can change the position (order) of sorted columns using the SortIndex property.
Set the SortIndex property to a non-negative integer to add the column to the sorted columns list. The column’s TreeListDataColumn.SortOrder property is automatically set to ColumnSortOrder.Ascending. Setting a column’s SortIndex property value to -1 cancels data sorting by this column.
To learn more, see Sorting.