A newer version of this page is available.
Switch to the current version.
ASPxGridHeaderFilterEventArgs.AddValue(String, String) Method
Adds a new filter item to the header filter.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v18.2.dll
Declaration
public void AddValue(
string displayText,
string value
)
Public Sub AddValue(
displayText As String,
value As String
)
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. |
Remarks
This method uses the equality operator to compare values. To provide your own filter criteria, use the AddValue method's overload with the query parameter.
Note that the grid header filter allows the use of HTML tags in the displayText parameter.
Examples
This example shows how to create custom filter items and display them within the Units On Order column's filter dropdown.
The image below shows the result:
protected void ASPxGridView1_HeaderFilterFillItems(object sender, DevExpress.Web.ASPxGridViewHeaderFilterEventArgs e) {
if (e.Column.FieldName != "UnitsOnOrder") return;
e.AddValue("nonzero", string.Empty, "[UnitsOnOrder] != 0");
e.AddValue(String.Format("from {0} to {1}", 0, 50), string.Empty, String.Format("[UnitsOnOrder] > {0} and [UnitsOnOrder] < {1}", 0, 50));
e.AddValue(String.Format(">= {0}", 50), string.Empty, String.Format("[UnitsOnOrder] >= {0}", 50));
}
See Also
Feedback