Skip to main content
A newer version of this page is available. .
Tab

ASPxGridBehaviorSettings.SortMode Property

Gets or sets how data is sorted.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

[DefaultValue(ColumnSortMode.Default)]
public ColumnSortMode SortMode { get; set; }

Property Value

Type Default Description
ColumnSortMode **Default**

A ColumnSortMode value that specifies the sort mode.

Available values:

Name Description
Default

Sorts the column’s data according to the type of the editor assigned to the column.

The Default option is equivalent to DisplayText for columns that use LookUpEdit, ImageComboBoxEdit and HypertextLabel (RepositoryItemHypertextLabel) in-place editors.

The Default option is equivalent to Value for other columns. Note that for certain editors (TextEdit, ComboBoxEdit, etc) the edit values match the display values.

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

Enables custom sorting of a column’s data. To implement custom sorting, handle the ColumnView.CustomColumnSort event in the GridControl, and the TreeList.CompareNodeValues event in the TreeList.

In the GridControl, the Custom mode also enables custom grouping of rows when grouping is applied against the current column. To implement custom grouping, handle the GridView.CustomColumnGroup event.

Property Paths

You can access this nested property as listed below:

Remarks

Find control-specific information (for ASPxGridView, ASPxCardView or ASPxVerticalGrid) in the sections below.

ASPxGridView

The SortMode property specifies the default algorithm used to sort column data (by display text, edit value or using a custom sorting algorithm). Individual data columns provide the GridDataColumnSettings.SortMode property, which overrides the default behavior.

To provide custom sorting and/or grouping, set the SortMode property to Custom and handle the ASPxGridView.CustomColumnSort event.

Grid View - Getting Started

ASPxCardView

The SortMode property specifies the default algorithm used to sort cards by column data (by display text, edit value or using a custom sorting algorithm). Individual data columns provide the GridDataColumnSettings.SortMode property, which overrides the default behavior.

To provide custom sorting and/or grouping, set the SortMode property to Custom and handle the ASPxCardView.CustomColumnSort event.

Card View - Getting Started

ASPxVerticalGrid

The SortMode property specifies the default algorithm used to sort row data (by display text, edit value or using a custom sorting algorithm). Individual data rows provide the GridDataColumnSettings.SortMode property, which overrides the default behavior.

To provide custom sorting and/or grouping, set the SortMode property to Custom and handle the ASPxVerticalGrid.CustomRowSort event.

Vertical Grid - Getting Started

See Also