Back to Devexpress

TreeListColumn.SortMode Property

windowsforms-devexpress-dot-xtratreelist-dot-columns-dot-treelistcolumn-35f1e15a.md

latest2.9 KB
Original Source

TreeListColumn.SortMode Property

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

Namespace : DevExpress.XtraTreeList.Columns

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[DefaultValue(ColumnSortMode.Default)]
[DXCategory("Data")]
[XtraSerializableProperty]
[XtraSerializablePropertyId(2)]
public ColumnSortMode SortMode { get; set; }
vb
<DXCategory("Data")>
<DefaultValue(ColumnSortMode.Default)>
<XtraSerializableProperty>
<XtraSerializablePropertyId(2)>
Public Property SortMode As ColumnSortMode

Property Value

TypeDefaultDescription
ColumnSortModeDefault

A ColumnSortMode value specifying how the column’s data is sorted in sort mode.

|

Available values:

NameDescription
Default

The actual sort mode is determined by a control. See the property description for more details.

| | 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).

| | Custom |

Applies sort options specified in the CustomColumnSort event handler.

In data grids, this mode also applies group options from the CustomColumnGroup event handler.

|

Remarks

The SortMode property determines the algorithm used to sort column data (by display text, edit value, or custom sort algorithm).

The Default option is DisplayText for columns that use LookUpEdit and ImageComboBoxEdit in-place editors. The Default option is Value for other columns.

Set the SortMode property to ColumnSortMode.Custom and handle the TreeList.CustomColumnSort event to apply custom sort options.

See Also

CustomColumnSort

TreeListColumn Class

TreeListColumn Members

DevExpress.XtraTreeList.Columns Namespace