Skip to main content
A newer version of this page is available. .
Tab

ASPxGridView.BeforeHeaderFilterFillItems Event

Enables you to provide custom filter items instead of default ones displayed within a Header Filter.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public event ASPxGridViewBeforeHeaderFilterFillItemsEventHandler BeforeHeaderFilterFillItems

Event Data

The BeforeHeaderFilterFillItems event's data class is ASPxGridViewBeforeHeaderFilterFillItemsEventArgs. The following properties provide information specific to this event:

Property Description
Column Gets the data column currently being filtered.
Handled Specifies whether the BeforeHeaderFilterFillItems event is handled. Inherited from ASPxGridBeforeHeaderFilterFillItemsEventArgs.
Values Gets a collection that contains the header filer values. Inherited from ASPxGridHeaderFilterEventArgs.

The event data class exposes the following methods:

Method Description
AddShowAll() Adds the ‘All’ item to the header filter. Inherited from ASPxGridHeaderFilterEventArgs.
AddShowBlanks(String) Creates and adds the “Blanks” filter value to the header filter values. Inherited from ASPxGridHeaderFilterEventArgs.
AddShowNonBlanks(String) Creates and adds the “(Non blanks)” filter value to the header filter values. Inherited from ASPxGridHeaderFilterEventArgs.
AddValue(String, CriteriaOperator) Adds a new filter item with the specified filter criteria operator to the header filter. Inherited from ASPxGridBeforeHeaderFilterFillItemsEventArgs.
AddValue(String, String, String) Adds a new filter item with the specified filter criteria to the header filter. Inherited from ASPxGridHeaderFilterEventArgs.
AddValue(String, String) Adds a new filter item to the header filter. Inherited from ASPxGridHeaderFilterEventArgs.
CreateShowBlanksValue(String) Creates and returns the (Blanks) filter item used to filter a column by blank values. Inherited from ASPxGridHeaderFilterEventArgs.
CreateShowNonBlanksValue(String) Creates and returns the (Non blanks) filter item used to filter a column by blank values. Inherited from ASPxGridHeaderFilterEventArgs.

Remarks

End-users can filter column values via the Header Filter. To invoke the filter dropdown, an end-user should click on the filter button. The BeforeHeaderFilterFillItems event is raised before the filter dropdown is shown and default filter items are created. The event enables you to provide custom filter items.

The data column whose filter button has been clicked is returned by the ASPxGridViewHeaderFilterEventArgs.Column property. To add a new filter value, use the ASPxGridHeaderFilterEventArgs.AddValue method.

Set the ASPxGridBeforeHeaderFilterFillItemsEventArgs.Handled property to true to prevent the ASPxGridView.HeaderFilterFillItems event from being raised. Otherwise, the event clears the item collection before filling it with default items.

If you would like to add custom items to the default items, use the ASPxGridView.HeaderFilterFillItems event.

Note

The ASPxGridView header filter allows the use of HTML tags in an item text. To learn more, see Header Filter.

See Also