Blazor Pivot Table Example - Value Sorting

Pivot Table / Sorting / Value Sorting

This sample demonstrates ordering of column and row header values in ascending or descending order. Here, the FY 2022 -> In Stock column header text and the France row header are both ordered by defining sort-related settings in code behind.

Loading Syncfusion Blazor Server Demos…

This sample demonstrates how to enable sorting for column and row values by simply clicking their headers. Repeated clicks toggle the sort direction. This functionality is activated by setting the EnableValueSorting property in SfPivotView to true.

You can also configure value-based sorting programmatically. To sort a column, specify the target header using the ColumnHeaderText property under PivotViewValueSortSettings, with individual header levels separated by a delimiter defined in the HeaderDelimiters property. Use ColumnSortOrder to set the sort direction. Similarly, to sort a row, provide the header in RowHeaderText and specify the direction using RowSortOrder.

This approach allows precise and independent control over sorting behavior for both columns and rows based on the provided headers.

More information on the value sorting feature can be found in this documentation section.

Transform your Blazor web apps today with Syncfusion® Blazor components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE