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

FilterValue.Query Property

Gets or sets the filter expression.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

public string Query { get; set; }

Property Value

Type Description
String

A String value that specifies the filter expression.

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.

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);
}

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);
See Also