GridDataColumnSettings.SortMode Property
Gets or sets how the column’s (row’s for ASPxVerticalGrid) data is sorted when sorting is applied to it.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v19.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
ColumnSortMode | **Default** | One of the ColumnSortMode enumeration values. |
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
The SortMode property specifies the algorithm used to sort the column’s data (by display text, edit value or using a custom sorting algorithm).
Set the SortMode property to Custom and handle the following events to provide custom sorting:
ASPxGridView: the ASPxGridView.CustomColumnSort event.
ASPxVerticalGrid: the ASPxVerticalGrid.CustomRowSort event.
ASPxCardView: the ASPxCardView.CustomColumnSort event.
Example
ASPxGridView:
<dx:ASPxGridView ID="grid">
<SettingsBehavior AllowSort="true">
<Columns>
<dx:GridViewDataColumn FieldName="ContactName" SortIndex="2" SortOrder="Ascending" >
<Settings AllowSort="false" SortMode="DisplayText" />
</dx:GridViewDataColumn>
...
</Columns>
</dx:ASPxGridView>
Concepts
ASPxGridView:
ASPxCardView:
ASPxVerticalGrid: