Back to Devexpress

ASPxGridView.BeforeHeaderFilterFillItems Event

aspnet-devexpress-dot-web-dot-aspxgridview-fea00fa4.md

latest5.5 KB
Original Source

ASPxGridView.BeforeHeaderFilterFillItems Event

Allows you to populate the header filter dropdown with custom items instead of default items.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public event ASPxGridViewBeforeHeaderFilterFillItemsEventHandler BeforeHeaderFilterFillItems
vb
Public Event BeforeHeaderFilterFillItems As ASPxGridViewBeforeHeaderFilterFillItemsEventHandler

Event Data

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

PropertyDescription
ColumnGets the data column currently being filtered.
HandledSpecifies whether the BeforeHeaderFilterFillItems event is handled. Inherited from ASPxGridBeforeHeaderFilterFillItemsEventArgs.
ValuesGets a collection that contains the header filer values. Inherited from ASPxGridHeaderFilterEventArgs.

The event data class exposes the following methods:

MethodDescription
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

The header filter allows users to filter column data. When a user clicks on the filter button, the grid displays a filter dropdown. The BeforeHeaderFilterFillItems event fires before the filter dropdown is shown and default filter items are created. The event allows you to create custom filter items.

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

Use the HeaderFilterFillItems event to add custom items to the default items.

Run Demo: Header Filter

See Also

Grid View

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace