Skip to main content
Tab

FilterValue.IsFilterByQuery Property

Indicates whether the complex filter expression is used to filter column values.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public bool IsFilterByQuery { get; }

Property Value

Type Description
Boolean

true if the complex filter expression is used to filter column values; otherwise, false.

Remarks

The FilterValue class provides two properties that enable you to specify the filter expression. These are: FilterValue.Value and FilterValue.Query properties.

The IsFilterByQuery property returns true if the FilterValue.Query property is specified. 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