Example of Default Sorting in Blazor Pivot Table Component
This sample demonstrates ordering fields in row and column axes either in ascending or descending order.
Grand Total |
---|
Grand Total | No records to display |
Properties
Fields:
|
|
Order:
|
|
In this sample, any field can be selected from the Fields dropdown list and its order can be changed to display headers either in ascending or descending order.
It can be applied either through code-behind or UI. To achieve this in code-behind, set the EnableSorting
property in PivotViewDataSourceSettings to true. Also, set the
PivotViewSortSettings in the pivot table along with the following properties:
Name |
: Specifies the normal field. |
Order |
: Specifies the sort order and it should be 'Ascending' or 'Descending' in this scenario. |
To achieve the same through UI, either enable grouping bar or field list or both to perform the sorting operation.
More information on the label sorting feature can be found in this documentation section.