Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[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
  [Expand]Reporting
  [Expand]Chart Control
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Data Editing
    [Collapse]Data Shaping and Manipulation
     [Expand]Data Summaries
     [Collapse]Filtering
       Filtering in Code
       Filter Row
       Filter Control
       Header Filter
       Search Panel
     [Expand]Grouping
     [Expand]Sorting
      Cell Merging
    [Expand]Data Formatting
    [Expand]Master-Detail Relationship
     Appearance Customization
     Adaptivity
     Save and Restore Layout
    [Expand]Templates
    [Expand]Export
     Toolbars
    [Expand]ASPxGridLookup
    ASPxGridView Designer
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
   [Expand]ASPxGridView - Animated Images
  [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
  [Expand]Pivot Grid
  [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

Header Filter

Column headers can display filter buttons. Clicking a filter button invokes a filter dropdown, which lists unique values within a column, and enables you to apply filter criteria against this column. These buttons are hidden by default. To show filter buttons, set the ASPxGridSettings.ShowHeaderFilterButton property to true. You can control the filter button availability for individual columns using a column's GridDataColumnSettings.AllowHeaderFilter property.

Note that if a filter is applied to a column, other column header filters display unique values of the sorted rows. To show the full list of values (include values of rows hidden by sorting), hold down SHIFT and click a header filter button.

If the control's ASPxGridBase.AccessibilityCompliant property is enabled, the Header filter supports keyboard navigation. Use Tab to focus a filter button. When the filter button is focused, press Enter to open a header filter popup window. Use Up and Down arrows to navigate the list of filter items. If the GridDataColumnHeaderFilterSettings.Mode property is set to CheckedList, use Tab for this purpose. To close the header filter popup window and apply filter criteria, use Enter. To close the popup window without saving changes in the filter criteria, use Esc.

Expanded Header Filter Modes

A Header filter can operate in the four modes listed below. A specific filter mode can be specified for individual columns using a column's GridDataColumnHeaderFilterSettings.Mode property.

The following two 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 a corresponding action and automatically closes the dropdown.

  • 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 the dropdown window is closed by clicking the OK button, the grid will display those records that contain checked values.

The following two list modes are available for date columns only.

Expanded Custom Header Filter Items

The ASPxGridView allows you to create custom filter values, define filter criteria for them and display these values within a column's filter dropdown. To do this, handle the ASPxGridView.HeaderFilterFillItems event. Within the event, you can access the filter default values using the ASPxGridHeaderFilterEventArgs.Values event parameter, and clear them if you so require. 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.

Expanded See Also

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