Skip to main content
A newer version of this page is available. .

End-User Filtering

  • 2 minutes to read

End-users can build simple filter criteria and apply them using a field’s filter drop-down. To prevent the invoking of the filter drop-down, disable the field’s PivotGridField.AllowFilter option.

pivotgrid_datafiltering

The filter drop-down contains unique field values. These values can be obtained via the PivotGridField.GetUniqueValues method.

Note

End-users cannot change filtering applied to data fields.

To create complex filter criteria, an end-user should use the Prefilter.

Availability

You can prevent end-users from applying or changing filtering at runtime by hiding filter buttons from field headers.

To hide filter buttons from all field headers, set the PivotGridControl.AllowFilter property to false. You can also do this for individual fields via their PivotGridField.AllowFilter properties.

Note that this does not affect filtering in code.

Displaying Only Available Filter Items

By default, a filter drop-down window invoked for a particular field contains all the unique field values, although some of these values may actually be excluded from the pivot grid by filtering applied to other fields.

Assume that a pivot grid contains two dimension fields: Category Name and Product Name.

ShowOnlyAvailableItems_PivotGrid

If you choose only one product category from the Category Name filter drop-down, all products related to other categories will be excluded from the pivot grid. This means that whether you check or uncheck any of these products in the Product Name filter drop-down, this will have no effect, since they are hidden by the category filtering.

PivotGridControl allows you to remove such field values from filter drop-downs. To do this, set the PivotGridControl.ShowOnlyAvailableFilterItems property to true.

The image below illustrates the property effect:

ShowOnlyAvailableFilterItems

See Also