Back to Devexpress

GridColumn.SortMode Property

maui-devexpress-dot-maui-dot-datagrid-dot-gridcolumn-e2e2793e.md

latest2.0 KB
Original Source

GridColumn.SortMode Property

Gets or sets whether the grid should sort or group data by column values or display text. This is a bindable property.

Namespace : DevExpress.Maui.DataGrid

Assembly : DevExpress.Maui.DataGrid.dll

NuGet Package : DevExpress.Maui.DataGrid

Declaration

csharp
public DataSortMode SortMode { get; set; }

Property Value

TypeDescription
DataSortMode

A value that specifies how to sort column values.

|

Available values:

NameDescription
Default

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

| | Value |

Sorts the column data by the column’s edit values (these are synchronized with the bound data source’s values).

| | DisplayText |

Sorts the column data by the column’s display text (that are strings displayed in column cells).

| | Custom |

Indicates that a custom algorithm is used to sort data. To implement the custom sort algorithm for a grid, handle its CustomSort event. In the DataGridView, the Custom mode also enables custom grouping for rows. To implement a custom group algorithm, handle the CustomGroup event.

|

Remarks

The following example enables sorting by values in a grid column:

xaml
<dxg:DataGridView.Columns>
    <dxg:TemplateColumn FieldName="Name" SortMode="Value">
         <!--...-->
    </dxg:TemplateColumn>
</dxg:DataGridView.Columns>

See Also

GridColumn Class

GridColumn Members

DevExpress.Maui.DataGrid Namespace