Back to Devexpress

DxGrid.AllowColumnReorder Property

blazor-devexpress-dot-blazor-dot-dxgrid-49506c7e.md

latest2.5 KB
Original Source

DxGrid.AllowColumnReorder Property

Specifies whether users can reorder columns.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(true)]
[Parameter]
public bool AllowColumnReorder { get; set; }

Property Value

TypeDefaultDescription
Booleantrue

true to allow users to reorder columns; otherwise, false.

|

Remarks

Default Grid settings allow users to drag and drop column headers to reorder columns:

Set the AllowColumnReorder property to false to prevent users from reordering columns:

razor
<DxGrid Data="Data"
        AllowColumnReorder="false">
    <Columns>
        <DxGridDataColumn FieldName="ContactName" MinWidth="100" />
        <DxGridDataColumn FieldName="ContactTitle" MinWidth="100" />
        <DxGridDataColumn FieldName="CompanyName" MinWidth="100" />
        <DxGridDataColumn FieldName="City" Width="10%" MinWidth="80" />
        <DxGridDataColumn FieldName="Country" Width="10%" MinWidth="80" />
        <DxGridDataColumn FieldName="Phone" Width="15%" MinWidth="80" Visible="false" />
    </Columns>
</DxGrid>

The AllowReorder property does not affect data grouping operations. If grouping is enabled, users can move headers between the Column Header Panel and the Group Panel, and change the group index. If you move a column header back to the Column Header Panel and column reordering is disabled, the column returns to the same position as in the column chooser. If you want to disable grouping, set the DxGrid.AllowGroup or DxGridDataColumn.AllowGroup property to false.

Use the AllowReorder property to disable reordering for an individual column.

Implements

AllowColumnReorder

See Also

DxGrid Class

DxGrid Members

DevExpress.Blazor Namespace