Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Collapse]Data Shaping
    [Expand]Aggregation
     Grouping
    [Expand]Sorting
    [Collapse]Filtering
     [Expand]Filtering Basics
      Group Filtering
      Prefilter
   [Expand]Data Analysis
   [Expand]Data Formatting
   [Expand]Layout
   [Expand]Appearance
   [Expand]Data Export
   [Expand]Design-Time Features
   [Expand]UI Elements
   [Expand]Examples
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Prefilter

The Prefilter feature serves two purposes. First, it enables ASPxPivotGrid to display a Filter Editor, allowing an end-user to apply filtering to the pivot grid's underlying data source at runtime. Second, you can filter the underlying data source in code, without displaying a Filter Editor to end-users.

Note

The Prefilter is not supported in OLAP mode.

Expanded Filter Editor

The Filter Editor enables end-users to build complex filter criteria with an unlimited number of filter conditions, combined by logical operators. The resulting filter condition will be combined with the field-based filter criteria using the AND Boolean operator. The Filter Editor provides a set of logical operators that significantly simplify the process of creating filters for text, numeric and date-time fields.

End-users can invoke the Filter Editor at runtime via a context menu.

To disable access to the Filter Editor via the context menu, set the PivotGridOptionsCustomization.AllowPrefilter property to false. In this instance, the Show Prefilter context menu item will be hidden, and you will be able to show the Filter Editor on the client-side using the ASPxClientPivotGrid.ShowPrefilter method.

To prevent a particular field from being displayed in the Filter Editor, and used in filter criteria built by end-users, use the PivotGridFieldOptions.ShowInPrefilter property.

Expanded Prefilter Panel

When the PivotGridOptionsCustomization.AllowPrefilter option is enabled and a filter condition is specified, ASPxPivotGrid displays a Prefilter Panel.

The Prefilter Panel displays a filter expression, a check box used to temporarily enable/disable the filtering, and a clear button used to reset the current filter condition.

Expanded Using Prefilter in Code

The Prefilter allows you to access its settings and specify filter criteria in code. To do this, use the ASPxPivotGrid.Prefilter property. The returned object exposes the following properties:

WebPrefilter.Criteria

WebPrefilter.CriteriaString

Gets or sets a Prefilter expression.
BaseFilter.Enabled Gets or sets whether the filter criteria, specified by the WebPrefilter.Criteria or WebPrefilter.CriteriaString property, are enabled.

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.

Note

The Prefilter cannot filter data against data fields. If a data field is used in filter criteria that has been specified in code, an error message will be displayed within the Prefilter Panel. This message also appears if filter criteria contains a field name that does not exist. Use the PrefilterBase.State property to determine whether or not the filter criteria are valid.

To learn more about filter criteria syntax, see Criteria Language Syntax.

After a filter condition has been changed via the Filter Editor or in code, the ASPxPivotGrid.PrefilterCriteriaChanged event is raised.

Expanded Client-Side Functionality

You can control the Prefilter functionality on the client side. The ASPxClientPivotGrid object exposes the following methods that allow you to do this.

ASPxClientPivotGrid.ShowPrefilter

ASPxClientPivotGrid.HidePrefilter

Invokes/hides the Filter Editor.
ASPxClientPivotGrid.IsPrefilterVisible Indicates whether or not the Filter Editor is visible.
ASPxClientPivotGrid.ChangePrefilterEnabled Enables or disables the current filter applied by the Filter Editor.
ASPxClientPivotGrid.ClearPrefilter Clears the filter expression applied using the Filter Editor.

Note

Use the ASPxPivotGrid.ClientInstanceName property to specify a unique client-side identifier for the ASPxPivotGrid.

Expanded See Also

How would you rate this topic?​​​​​​​