Back to Devexpress

WebFilter.CriteriaString Property

aspnet-devexpress-dot-web-dot-aspxpivotgrid-dot-data-dot-webfilter.md

latest2.1 KB
Original Source

WebFilter.CriteriaString Property

Gets or sets the filter expression as a string.

Namespace : DevExpress.Web.ASPxPivotGrid.Data

Assembly : DevExpress.Web.ASPxPivotGrid.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public string CriteriaString { get; set; }
vb
<DefaultValue("")>
Public Property CriteriaString As String

Property Value

TypeDefaultDescription
StringString.Empty

A String value that specifies the filter expression as a string.

|

Remarks

You can set the filter expression as a string and assign it to the CriteriaString property. Another way is to assign the filter expression to the Criteria property.

The code snippet below shows how to apply filters in two ways:

csharp
protected void Page_Load(object sender, EventArgs e) {
  if (!IsPostBack && !IsCallback)
    ASPxPivotGrid1.Filter.CriteriaString = "[" + fieldOrderYear.ID + "] = 2018 AND [" + fieldOrderQuarter.ID + "] between (2, 4)";
    /*ASPxPivotGrid1.Filter.Criteria = 
      CriteriaOperator.And(
        new BinaryOperator(fieldOrderYear.ID, 2018, BinaryOperatorType.Equal), 
        new BetweenOperator(fieldOrderQuarter.ID, 2, 4)
      );*/
}

Note

The filter expression is not supported in OLAP mode.

See Also

WebFilter Class

WebFilter Members

DevExpress.Web.ASPxPivotGrid.Data Namespace