Skip to main content

BinaryOperator Class

A logical expression which consists of a BinaryOperatorType operation between two operands.

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v21.2.dll

Declaration

public class BinaryOperator :
    CriteriaOperator

The following members accept/return BinaryOperator objects:

Remarks

The BinaryOperator can be used in search criteria to filter objects. To learn more, see Simplified Criteria Syntax, Criteria Operators, and NULL Value Handling Specifics.

Example

The following code demonstrates how to get a collection of “MyObject” objects that match specific criteria. The collection returned is used as a data source for a grid control. In this example, objects that have a value equal to or greater than 20 in their “UnitPrice” field are returned. To create the filter criteria a specific BinaryOperator operator is used.

using DevExpress.Xpo;
using DevExpress.Data.Filtering;

// Custom XP object.
class MyObject : XPObject {
   decimal unitPrice;

   public decimal UnitPrice {
      get { return unitPrice; }
      set { unitPrice = value; }
   }
   //...
}

// Select MyObject objects that match the specified criteria.
decimal filterValue = 20;
gridControl1.DataSource = new XPCollection(Session.DefaultSession, typeof(MyObject), 
  new BinaryOperator("UnitPrice", filterValue, BinaryOperatorType.GreaterOrEqual));

The following code snippets (auto-collected from DevExpress Examples) contain references to the BinaryOperator class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

See Also