Example of Value Sorting in ASP.NET MVC Pivot Table Control
This sample demonstrates ordering of column and row header values in ascending or descending order. Here, the FY 2015 → In Stock column header and the France row header are both ordered by defining sort-related settings in code behind.
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 to true.
You can also configure value-based sorting programmatically. To sort a column, specify the target header using
the columnHeaderText
property under valueSortSettings
, with individual header levels
separated by a delimiter defined in the headerDelimiter
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.