Skip to main content

GroupOperator Class

A logical expression which groups two or more operands with a logical AND or OR.

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v23.2.dll

NuGet Package: DevExpress.Data

Declaration

public sealed class GroupOperator :
    CriteriaOperator

The following members return GroupOperator objects:

Remarks

The GroupOperator can be used to build criteria expressions when filtering objects. For more information, refer to Creating Criteria and Criteria Operators.

Tip

You can find examples in the following article: Build Criteria - Cheat Sheet.

Examples

This example retrieves the cars that belong in the Saloon category and which cost less than $100,000.

The result is shown in the image below:

XPView_GroupCriteria1

xpView1.GroupCriteria = GroupOperator.And(new BinaryOperator("Category", "Saloon"), 
  new BinaryOperator("Price", 100000, BinaryOperatorType.Less));

Return orders that have Price equal to 20 or OrderName equal to ‘Order3’.

Expression:

CriteriaOperator.FromLambda<Order>(o => o.Price==20 || o.OrderName == "Order3");
Test

Input:

OrderName

Price

Order0

10

Order1

20

Order2

30

Order3

40

The result:

OrderName

Order1

Order3

Inheritance

See Also