Back to Devexpress

DxTreeList.AllowColumnReorder Property

blazor-devexpress-dot-blazor-dot-dxtreelist-ef402903.md

latest2.7 KB
Original Source

DxTreeList.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

The TreeList component allows users to drag and drop column headers to reorder columns:

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

razor
<DxTreeList Data="Data"
            AllowColumnReorder="false"
            ChildrenFieldName="Satellites">
    <Columns>
        <DxTreeListDataColumn FieldName="Name"/>
        <DxTreeListDataColumn FieldName="TypeOfObject" Caption="Type"/>
        <DxTreeListDataColumn FieldName="Mass10pow21kg" Caption="Mass" DisplayFormat="N2">
            <HeaderCaptionTemplate>Mass, 10<sup>21</sup> &#215; kg</HeaderCaptionTemplate>
        </DxTreeListDataColumn>
        <DxTreeListDataColumn FieldName="MeanRadiusInKM" Caption="Radius" DisplayFormat="N2">
            <HeaderCaptionTemplate>Radius, km</HeaderCaptionTemplate>
        </DxTreeListDataColumn>
        <DxTreeListDataColumn FieldName="Volume10pow9KM3" Caption="Volume" DisplayFormat="N2">
            <HeaderCaptionTemplate>Volume, 10<sup>9</sup> &#215; km<sup>3</sup></HeaderCaptionTemplate>
        </DxTreeListDataColumn>
        <DxTreeListDataColumn FieldName="SurfaceGravity" Caption="Gravity" DisplayFormat="N2">
            <HeaderCaptionTemplate>Gravity, m/s<sup>2</sup></HeaderCaptionTemplate>
        </DxTreeListDataColumn>
        <DxTreeListDataColumn FieldName="Density" Visible="false" DisplayFormat="N2">
            <HeaderCaptionTemplate>Density, g/cm<sup>3</sup></HeaderCaptionTemplate>
        </DxTreeListDataColumn>
    </Columns>
</DxTreeList>

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

Implements

AllowColumnReorder

AllowColumnReorder

See Also

DxTreeList Class

DxTreeList Members

DevExpress.Blazor Namespace