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

TreeListDataColumn.SortMode Property

Gets or sets how the column’s data is sorted when sorting is applied to it.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v18.2.dll

Declaration

[DefaultValue(TreeListColumnSortMode.Default)]
public TreeListColumnSortMode SortMode { get; set; }

Property Value

Type Default Description
TreeListColumnSortMode **Default**

One of the TreeListColumnSortMode enumeration values.

Available values:

Name Description
Default

If a column’s TreeListDataColumn.SortMode property is set to default, the column’s data will be sorted according to the TreeListSettingsBehavior.SortMode property. If both those properties are set to Default, the grid data is sorted by the column’s edit values (these are synchronized with the bound data source’s values).

Value

Sorts the column’s data by the column’s edit values (these are synchronized with the bound data source’s values).

DisplayText

Sorts the column’s data by the column’s display text (the strings displayed within the column’s cells).

Remarks

The SortMode property specifies the algorithm used to sort the column’s data (by display text or edit value).

Example

The following example illustrates how to use the TreeListDataColumn.SortMode property for the ASPxTreeList‘s column.

ASPxTreeList-SortMode-Column

protected void ASPxTreeList1_CustomColumnDisplayText(object sender, DevExpress.Web.ASPxTreeList.TreeListColumnDisplayTextEventArgs e)
{
    if (e.Column.FieldName != "UnitsOnOrder") return;
    if (Convert.ToInt32(e.Value) == 0)
        e.DisplayText = "empty";
    if (Convert.ToInt32(e.Value) > 0 && Convert.ToInt32(e.Value) <= 50)
        e.DisplayText = "1-50";
    if (Convert.ToInt32(e.Value) > 51 && Convert.ToInt32(e.Value) <= 100)
        e.DisplayText = "51-100";
}
See Also