[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
   Getting Started
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Bind to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Edit Data
    [Expand]Use Data Summaries
    [Collapse]Filter Data
      Filtering in Code
      Filter Row
      Filter Control
      Header Filter
      Search Panel
    [Expand]Group Data
    [Expand]Sort Data
     Merge Data Cells
     Save and Restore Client Layout
    [Expand]Format Data
    [Expand]Master-Detail Relationship
     Appearance Customization
     Adaptivity
     GridView Table Layout
    [Expand]Templates
    [Expand]Export
     Toolbars
    [Expand]ASPxGridLookup
    Grid Designer
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Gantt
  [Expand]Card View
   Reporting
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [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]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Header Filter

End users can click a column header button to invoke a drop-down window with filter controls. The drop-down window's appearance and functionality depend on the column type and grid settings. Refer to the “Header Filter Modes” section for a list of available UIs.
The following properties specify the filter button's availability:

Property Description
ASPxGridSettings.ShowHeaderFilterButton Shows or hides filter buttons for all columns in the grid control.
GridDataColumnSettings.AllowHeaderFilter Specifies whether a filter button is available in a column.

If a filter is applied to a column, other column header filters display the sorted rows' unique values. To show the full list of values (including hidden rows' values), hold down SHIFT and click a header filter button.

The Header filter supports keyboard navigation if the control's ASPxGridBase.AccessibilityCompliant property is enabled. You can use Tab to focus the filter button and press Enter to open a header filter popup window. Use Up and Down arrows to navigate the list of filter items, or Tab if the GridDataColumnHeaderFilterSettings.Mode property is set to CheckedList. To close the header filter popup window and apply the filter criteria, use Enter. Press Esc to close the popup window without saving changes.

Expanded Header Filter Modes

You can use a column's GridDataColumnHeaderFilterSettings.Mode property to specify its filter mode.

The following list modes are available for all grid columns:

  • List. The header filter is displayed as a regular list of filter items. Clicking an item invokes the corresponding action and automatically closes the drop-down list.

  • CheckedList. The header filter is displayed as a checked list of filter items. In this mode, an end user can select multiple items simultaneously. When you click OK to close the drop-down window, the grid displays the records that contain checked values.

    1

The following list modes are available for date columns only:

Note

Refer to the Criteria Language Syntax and FunctionOperatorType topics that describe how to compose complex filter criteria using function operators.

Expanded Custom Header Filter Items

The ASPxGridView allows you to create custom filter values, define their filter criteria, and display these values within a column's drop-down filter. To do this, handle the ASPxGridView.HeaderFilterFillItems event. You can use the ASPxGridHeaderFilterEventArgs.Values event parameter to access the default filter values. To add a new filter item, use the ASPxGridHeaderFilterEventArgs.AddValue method. In the List mode, you can use the ASPxGridHeaderFilterEventArgs.AddShowAll method to add a ShowAll button to the list.

The FilterValue.CreateShowAllValue, FilterValue.CreateShowBlanksValue, and FilterValue.CreateShowNonBlanksValue methods can be used to create the corresponding filter items.

This example shows how to create custom filter items and display them within the Units On Order column's filter dropdown.

The image below shows the result:

Expanded Using HTML tags in an item text

The ASPxGridView header filter allows you to use HTML tags in an item text. This example demonstrates how you can set numbers in bold by using HTML tags within an item's format pattern. The image below shows the result.

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