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.v19.2.dll

Declaration

[DefaultValue(TreeListColumnSortMode.Default)]
public TreeListColumnSortMode SortMode { get; set; }
<DefaultValue(TreeListColumnSortMode.Default)>
Public Property SortMode As TreeListColumnSortMode

Property Value

Type Default Description
TreeListColumnSortMode

Default

One of the TreeListColumnSortMode enumeration values.

Remarks

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

Examples

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