Skip to main content
Tab

FilterValue.IsFilterByValue Property

Indicates whether the Equals to filter criterion is used.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public bool IsFilterByValue { get; }

Property Value

Type Description
Boolean

true if the Equals to filter criterion 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 IsFilterByValue property returns true if the FilterValue.Query property isn’t 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