blazor-devexpress-dot-blazor-dot-dxtreelist-6a8084fa.md
Specifies whether users can sort treelist data.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(true)]
[Parameter]
public bool AllowSort { get; set; }
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true to allow users to sort treelist data; otherwise, false.
|
The component allows users to sort data as follows:
Users can focus a column header and press Space, Shift+Space, or Ctrl+Space to change sort settings. Refer to the following topic for additional information on keyboard shortcuts: Keyboard Support in Blazor TreeList.
Users can focus a column header and press Space, Shift+Space, or Ctrl+Space to change sort settings.
Set the TreeList’s AllowSort property to false to prevent users from sorting TreeList data. The column’s AllowSort property allows you to specify whether users can sort TreeList data by this column. Note that the value specified at the column level overrides that of the component level.
The following code snippet prevents users from sorting TreeList data:
<DxTreeList Data="Data"
AllowSort="false">
<Columns>
<DxTreeListDataColumn FieldName="Name"/>
<DxTreeListDataColumn FieldName="TypeOfObject" Caption="Type"/>
<DxTreeListDataColumn FieldName="Mass10pow21kg" Caption="Mass" DisplayFormat="N2">
<HeaderCaptionTemplate>Mass, 10<sup>21</sup> × 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> × 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>
See Also