BinaryOperator Class

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

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v20.2.dll


public class BinaryOperator :

The following members accept/return BinaryOperator objects:


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.


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));


See Also