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

How to: Add Custom Filter Values to the Filter Dropdown

This example shows how to create custom filter items and display them within the Quantity column’s filter dropdown.

The image below shows the result:

ASPxCardView_Ex_HeaderFilterFillItems

protected void CardView_HeaderFilterFillItems(object sender, ASPxCardViewHeaderFilterEventArgs 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));
}