How to: Add Custom Filter Values to the Filter Dropdown

The following example creates custom filter items and displays 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));
}