Skip to main content

TreeListColumn.SortMode Property

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

Namespace: DevExpress.XtraTreeList.Columns

Assembly: DevExpress.XtraTreeList.v23.2.dll

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

Declaration

[DefaultValue(ColumnSortMode.Default)]
[DXCategory("Data")]
[XtraSerializableProperty]
[XtraSerializablePropertyId(2)]
public ColumnSortMode SortMode { get; set; }

Property Value

Type Default Description
ColumnSortMode Default

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

Available values:

Name Description
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