Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Collapse]Data Shaping
    [Expand]Summarization
     Grouping
    [Expand]Sorting
    [Collapse]Filtering
     [Collapse]Filtering Basics
       End-User Filtering
       Filtering in Code
       OLAP Filtering Specifics
      Group Filtering
      Prefilter
     [Expand]Filtering by Summaries
    [Expand]Editing
     Data Formatting
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Focus and Navigation
   [Expand]Printing and Exporting
   [Expand]Appearance
   [Expand]Design-time Features
   [Expand]Miscellaneous
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET 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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Filtering in Code

In addition to end-user filtering, PivotGridControl provides the capability to specify filter conditions in code.

Expanded Filter Field Values in Code

To display only the required data, add the necessary values to the PivotGridFieldBase.FilterValues collection. The type of the filter values should be the same as the value type of the current field.

The filtering functionality depends upon the PivotGridFieldFilterValues.FilterType property. This property specifies whether filter values should be displayed in or hidden from the pivot grid.

Specific fields can contain null (or DBNull) values. The PivotGridFieldFilterValues.ShowBlanks property determines whether or not the records that contain such values should be processed by the control. If this property is set to false, summaries are not calculated for these records.

Expanded Example

The following example shows how to apply a filter to a field. The filter will select those records which contain 'Brazil' or 'USA' in the 'Country' field.

Expanded See Also

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