Skip to main content
Tab

ASPxGridHeaderFilterEventArgs.AddValue(String, String, String) Method

Adds a new filter item with the specified filter criteria to the header filter.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public void AddValue(
    string displayText,
    string value,
    string query
)

Parameters

Name Type Description
displayText String

A String value that specifies the filter item’s display text.

value String

A String value that specifies the filter item’s value.

query String

A String value that represents the filter criteria.

Remarks

Note that the ASPxGridView header filter allows the use of HTML tags in the displayText parameter.

Example

This example creates custom filter items and displays them within the Units On Order column’s filter dropdown.

HeaderFilterFillItems

protected void ASPxGridView1_HeaderFilterFillItems(object sender, DevExpress.Web.ASPxGridViewHeaderFilterEventArgs e) {
        if (e.Column.FieldName != "Quantity") return;
        e.AddValue("nonzero", string.Empty, "[Quantity] != 0");
        e.AddValue(String.Format("from {0} to {1}", 0, 50), string.Empty, String.Format("[Quantity] > {0} and [Quantity] < {1}", 0, 50));
        e.AddValue(String.Format(">= {0}", 50), string.Empty, String.Format("[Quantity] >= {0}", 50));
}
See Also