Filtering
The PivotGrid supports filtering both in the OLAP and flat data-binding scenarios.
The PivotGrid uses kendo.data.PivotDataSource
to perform label
filtration. However, it filters only by the caption value of the members.
The filter descriptor is similar to the filter option of the kendo.data.DataSource
and contains the following options:
-
field
—The full path to the tuple member. For example,[Date].[Calendar].[Calendar Year].&[2005]
. -
operator
—All operators that work with strings. Note that the widget treats field values as strings. -
value
—The filter value.
Filtering when using Xmla DataSource
To set a predefined filter when using Xmla data use the above-described approach and set the filter configuration of the PivotDataSource, following the guidelines for MDX queries and Members, Tuples, and Sets.
.Filter(f =>
{
f.Add("[Geography].[City]").StartsWith("Ev");
f.Add("[Date].[Calendar]").In("[Date].[Calendar].[Calendar Year].&[2010],[Date].[Calendar].[Calendar Year].&[2013]");
})
Filtering when using Flat Data
Build the filter descriptor similar to the filter option of the kendo.data.DataSource
.
.Filter(f =>
{
f.Add(p=>p.ProductName).Contains("An");
f.Add(p => p.Discontinued).IsEqualTo(true);
})