[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Collapse]Data Shaping
      Filter Drop-Down
      Filter Editor
      Filter Panel
      Filter Elements
      Group Filtering
      Filtering in Code
      OLAP Filtering Specifics
    [Expand]Data Formatting
   [Expand]Data Analysis
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Group Filtering

The group filtering allows end users to filter the Pivot Grid's data against groups of fields.

Expanded Field Filter Limitations

The field filter contains a collection of filter values. Each of the filter values corresponds to a unique value stored in the underlying data source in the current field. Depending on the filter type, the pivot grid shows only those rows and columns that contain the filter values in the corresponding fields, or hides those rows and columns. See Filtering Basics for details.

The field filter has little effect when used to filter data against the grouped fields. These fields are hierarchically arranged, while the field filter performs filtering based on the values of individual fields, and does not take into account the field hierarchy. For more information about groups, see Field Groups.

The image below shows the PivotGridControl, whose Column Header Area contains two fields: 'Year' and 'Quarter'.

The field filter can hide all 'Qtr3' columns, but it cannot hide the individual column corresponding to 'Qtr3 2014'. The group filter is introduced to solve the problem.

Expanded Group Filtering Mechanism

The group filter filters data against the values of grouped fields and manages a collection of group filter values. The PivotGroupFilterValues.Values property provides access to group filter values. Each of the filter values corresponds to a field value from one of the grouped fields.

Similarly to the values of grouped fields, the group filter values are hierarchically arranged. The PivotGroupFilterValues.Values collection contains values from the first field in the group (first-level values). Each of the first-level values holds a collection of values from the second field in the group (child values), and etc.

The group filter values are used to define which data source records should be processed by the pivot grid control. A group filter value corresponds to a data source record if the following conditions are met:

  • The data source record contains the group filter value in the respective field.
  • The data source record contains the group filter value's ancestor values in the respective fields.
  • The group filter value does not contain child values.

If the GroupFilterValues.FilterType property is set to FieldFilterType.Included, only the data source records that correspond to one of the filter values are processed. For the FieldFilterType.Excluded filter type, the data source records that do not correspond to any filter value are processed.

The image below shows the PivotGridControl with the filter drop-down invoked for the 'Year-Quarter' group. The filter values collection contains a '2015' value, which has the 'Qtr2' and 'Qtr4' child values, and the filter type is set to FieldFilterType.Excluded. As a result, the columns that correspond to the 'Qtr2' and 'Qtr4' 2015 are hidden, while the 'Qtr2' column for 2016 is displayed.

Expanded Using the Group Filter

The group filter condition is the GroupFilterValues object stored in the group's PivotGridGroup.FilterValues property. To apply a group filter in code, specify the appropriate filter type with the GroupFilterValues.FilterType property, and add filter values to the PivotGroupFilterValues.Values collection.

The group filter can be disabled using the PivotGridControl.GroupFilterMode property. By default, the property is set to GroupFilterMode.Tree. To disable the group filter, set the PivotGridControl.GroupFilterMode property to GroupFilterMode.List. In this instance, pivot grid data will be filtered against grouped fields using the standard field filter.

Regardless of the currently selected group filter mode, you can customize in code both group and field filters. The customizations made for the currently unused field filter take effect when you turn the group filter off.

End users can use the group filter drop-down to apply, remove, and change group filters.

Expanded Example

Is this topic helpful?​​​​​​​