DxTreeListDataColumn.SortOrder Property
Specifies the column’s sort order (ascending or descending).
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
[DefaultValue(TreeListColumnSortOrder.None)]
[Parameter]
public TreeListColumnSortOrder SortOrder { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Tree |
None | An enumeration value. |
Available values:
Name | Description |
---|---|
None | The Tree |
Ascending | The Tree |
Descending | The Tree |
#Remarks
When you specify a column’s SortIndex property, the TreeList sorts column data in ascending order. Use the SortOrder
property to change the sort order.
The following example sorts TreeList data by the Due Date column in descending order, and then sorts data by the Name column in ascending order:
@inject EmployeeTaskService EmployeeTaskService
<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" SortIndex="1" />
<DxTreeListDataColumn FieldName="EmployeeName" />
<DxTreeListDataColumn FieldName="StartDate" />
<DxTreeListDataColumn FieldName="DueDate"
SortIndex="0"
SortOrder="TreeListColumnSortOrder.Descending" />
</Columns>
</DxTreeList>
@code {
List<EmployeeTask> TreeListData { get; set; }
protected override void OnInitialized() {
TreeListData = EmployeeTaskService.GenerateData();
}
}
For more information about data sorting in the TreeList component, refer to the following topic: Sort Data in Blazor TreeList.