Back to Devexpress

DataGridView.AllowSort Property

maui-devexpress-dot-maui-dot-datagrid-dot-datagridview-85a88af2.md

latest1.6 KB
Original Source

DataGridView.AllowSort Property

Gets or sets whether users can sort data in the grid. This is a bindable property.

Namespace : DevExpress.Maui.DataGrid

Assembly : DevExpress.Maui.DataGrid.dll

NuGet Package : DevExpress.Maui.DataGrid

Declaration

csharp
public bool AllowSort { get; set; }

Property Value

TypeDescription
Boolean

true if users can sort data; otherwise, false.

|

Remarks

The following example shows how to disable sorting for all columns except for the “Employee” column:

xaml
<dxg:DataGridView AllowSort="False">
    <dxg:DataGridView.Columns>
        <dxg:TemplateColumn FieldName="Name" Caption="Employee" AllowSort="True">
            <!--...-->
        </dxg:TemplateColumn>
    </dxg:DataGridView.Columns>
</dxg:DataGridView>

Use the GridColumn.AllowSort property to enable/disable sorting for an individual column.

Refer to the following topic for more information about the sorting functionality in the Data Grid View: How to Sort Rows in DevExpress Data Grid for .NET MAUI.

See Also

AllowSort

DataGridView Class

DataGridView Members

DevExpress.Maui.DataGrid Namespace