TreeViewControl.SortMode Property
Gets or sets how the TreeViewControl sorts its data. This is a dependency property.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Default | Description |
---|---|---|
ColumnSortMode | Default | The 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 In data grids, this mode also applies group options from the |
Remarks
The SortMode
property specifies the algorithm used to sort TreeViewControl data (by display text, edit value, or a custom sorting algorithm).
The Default
option is DisplayText
if the TreeViewControl uses in-place editors inherited from the LookUpEditSettingsBase class (ComboBoxEditSettings, LookUpEditSettings). The Default
option is Value
in other cases.
Follow the steps below to apply custom logic to sort data:
- Set the SortOrder property to
Ascending
orDescending
. - Set the
SortMode
property toCustom
. - Handle the CustomNodeSort event.