Back to Devexpress

TreeViewControl.SortMode Property

wpf-devexpress-dot-xpf-dot-grid-dot-treeviewcontrol-dc8a51d8.md

latest2.7 KB
Original Source

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

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

Property Value

TypeDefaultDescription
ColumnSortModeDefault

The 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 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:

  1. Set the SortOrder property to Ascending or Descending.
  2. Set the SortMode property to Custom.
  3. Handle the CustomNodeSort event.

See Also

TreeViewControl Class

TreeViewControl Members

DevExpress.Xpf.Grid Namespace