BinaryOperator Class

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

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v19.2.dll

Declaration

public class BinaryOperator :
    CriteriaOperator
Public Class BinaryOperator
    Inherits CriteriaOperator

Remarks

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

Examples

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

Inheritance

See Also