Search results

Member filtering

Member filtering allows you to view Pivot Grid with particular records based on filter criteria.

Filtering through UI

Filtering can also be performed through UI option available in grouping bar and field list at run time.

Filtering through code

It can be configured using the filterSettings option through code-behind. The settings required to filter at initial rendering are:

  • name: It allows to set field name.
  • type: It allows to set filter type as either “Include” or “Exclude” to the field.
  • items: It allows to set the filter members of the field.
tagHelper
Filtering.cs
<ejs-pivotview id="PivotGrid" height="300">
    <e-datasource data="@ViewBag.data" expandAll="false">
        <e-filtersettings>
            <e-field name="Country" type="Exclude" items="@ViewBag.filterMembers"></e-field>
        </e-filtersettings>
        <e-rows>
            <e-field name="Country"></e-field>
            <e-field name="Products"></e-field>
        </e-rows>
        <e-columns>
            <e-field name="Year" caption="Production Year"></e-field>
            <e-field name="Quarter"></e-field>
        </e-columns>
        <e-values>
            <e-field name="Sold" caption="Units Sold"></e-field>
            <e-field name="Amount" caption="Sold Amount"></e-field>
        </e-values>
    </e-datasource>
</ejs-pivotview>
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    ViewBag.filterMembers = new string[] { "United States" };
    return View();
}