The DevExpress ASP.NET MVC GridView implements a column header filter that displays a dropdown list of all unique values within a column. Set the ShowHeaderFilterButton to true to show header filter buttons for each data column. You can use the AllowHeaderFilter property to control the button visibility for a particular data column.
Users can enter text in the filter editor above the list to filter list items. To hide the filter editor, set the ShowHeaderFilterListBoxSearchUI property to false.
A column’s Mode property specifies the filter mode. You can set the following filter modes for each grid data column.
- List – the dropdown window displays a regular list of items that allows users to select a single value.
- CheckedList – the dropdown window displays a check box list that allows users to select multiple values.
Additionally, the grid control implements filter modes for specific column data types: DateRangeCalendar and DateRangePicker modes available for date columns; NumericRangePicker mode available for numeric columns. You can try these modes in the Range Header Filter demo.
You can handle the following events to customize the header filter items:
- BeforeHeaderFilterFillItems event – allows you to populate the header filter dropdown with custom items instead of default items.
- HeaderFilterFillItems event – allows you to add custom filter items to default items.
In this demo, the header filters of the Total and Quantity columns contain custom items.
Local Copy of this Demo To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer. |
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxGridViewDemos |