By default, end users can invoke a Filter Editor at runtime via the context menu. The Filter Editor provides an advanced UI that allows end-users to build complex filter criteria with an unlimited number of filter conditions combined by logical operators. The resulting filter condition is combined with filter conditions defined by individual fields.

For the classic version the context menu looks as follow:

The Filter Editor may contain a text panel, a visual panel, or both. This characteristic is determined by the PivotGridControl.DefaultFilterEditorView property.
To learn how to interact with a Filter Editor at runtime, see the Filter Editor topic from End-User Documentation.
You can prevent end-users from invoking a Filter Editor by disabling the PivotGridOptionsCustomization.AllowPrefilter option. In this instance, the Show Filter context menu item will be hidden, and the Filter Editor will be able to be invoked only in code.
To prevent a particular field from being displayed in a Filter Editor, and used in filter criteria built by end-users, use the PivotGridFieldOptions.ShowInPrefilter property.
When the PivotGridOptionsCustomization.AllowPrefilter option is enabled, and a filter condition is specified, Pivot Grid Control displays a Filter Panel.

The Filter Panel displays:
- Filter expression displays active filters.
- Edit button that invokes a Filter Editor.
- Check box that temporarily enables/disables the filtering.
- Clear button that resets the current filter condition.
- MRU filter button that opens MRU filter list.
- <b>MRU filter list</b> that displays the last filters applied to the Pivot Grid.
Use the PivotGridAppearances.PrefilterPanel property to customize the Prefilter Panel appearance.
For the classic version the filter panel looks as follow:

The Prefilter Panel displays:
- Filter expression displays active filters.
- Edit button that invokes a Filter Editor.
- Check box that temporarily enables/disables the filtering.
- Clear button that resets the current filter condition.
The Prefilter allows you to access its settings and specify filter criteria in code. To do this, use the PivotGridControl.Prefilter property. The returned object exposes the following properties and methods.
When you create a filter expression in code, use the PivotGridFieldBase.PrefilterColumnName property to refer to a field. The sample below shows how to do this.
C# |
pivotgridControl1.Prefilter.CriteriaString = "[" + fieldCategory.PrefilterColumnName + "] Like 'B%'";
|
VB |
pivotgridControl1.Prefilter.CriteriaString = "[" + fieldCategory.PrefilterColumnName + "] Like 'B%'"
|
Note
Prefilter cannot filter data against data fields. If a data field is used in a filter criteria that has been specified in code, an error message will be displayed within the Prefilter Panel. This message also appears if a filter criteria contains a field name that does not exist. Use the PrefilterBase.State property to determine whether the filter criteria is valid or not.
To learn more about filter criteria syntax, see the Pivot Grid Expression Syntax document.
After a filter condition has been changed via a Filter Editor or in code, the PivotGridControl.PrefilterCriteriaChanged event is raised.