FilterValue.Value Property
In This Article
Gets or sets the filter value.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
#Property Value
Type | Description |
---|---|
String | A String value that specifies the filter item’s value. |
#Remarks
The FilterValue class provides two properties that enable you to specify the filter expression. These are: FilterValue.Value
and FilterValue.Query properties.
The filter expression specified by the FilterValue.Query property takes priority over the filter expression specified by the FilterValue.Value
property.
Use the FilterValue.Value
property to create the Equals to expression.
// Example: Equals to 50
FilterValue filterItem1 = new FilterValue();
filterItem1.DisplayText = "Filter Value1";
filterItem1.Value = "50";
e.Values.Add(filterItem1);
To create complex filter expressions, use the FilterValue.Query property:
protected void ASPxGridView1_HeaderFilterFillItems(object sender,
ASPxGridViewHeaderFilterEventArgs e)
{
if (e.Column.FieldName != "ProductName") return;
e.Values.Clear();
FilterValue fv = new FilterValue("Low Price Products", null);
fv.Query = string.Format("[UnitPrice] < {0} AND [Discontinued] = {1}", 10, true);
e.Values.Add(fv);
}
See Also