Search results

Value Sorting in ASP.NET Core Pivot Grid control

14 Oct 2021 / 1 minute to read

Value sorting allows you to sort individual column based on it’s values either in ascending or descending order. It can been enabled by setting the enableValueSorting property to true. You can sort the column values by clicking the column header.

Value sorting can be configured using the valueSortSettings option through code behind. The settings required to sort value fields at initial rendering are:

  • headerText: It allows to set the column header names with delimiters, that is used for value sorting.
  • headerDelimiter: It allows to set the delimiters string to separate the given header text.
  • sortOrder: It allows to set the sort direction of the value field.
Copied to clipboard
<ejs-pivotview id="PivotGrid" height="300" enableValueSorting="true">
    <e-datasource data="" expandAll="false">
        <e-valuesortsettings headerText="FY 2015##Sold Amount" headerDelimiter="##" sortOrder="Descending"></e-valuesortsettings>
            <e-field name="Country"></e-field>
            <e-field name="Products"></e-field>
            <e-field name="Year" caption="Production Year"></e-field>
            <e-field name="Quarter"></e-field>
            <e-field name="Sold" caption="Units Sold"></e-field>
            <e-field name="Amount" caption="Sold Amount"></e-field>
Copied to clipboard
public ActionResult Index()
    var data = GetPivotData(); = data;
    return View();

See Also