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.v24.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 |
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.
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";
}