Skip to main content

ContainsOperator(String, CriteriaOperator) Constructor

Initializes a new instance of the ContainsOperator class with the specified property and criteria expression.

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v23.2.dll

NuGet Package: DevExpress.Data

Declaration

public ContainsOperator(
    string collectionProperty,
    CriteriaOperator condition
)

Parameters

Name Type Description
collectionProperty String

A String value which identifies the property whose values will be searched.

condition CriteriaOperator

A CriteriaOperator object that represents a search criteria.

Example

This sample code selects Person objects that contain at least one object in their Addresses collection property with the City property set to “Chicago”

The image below shows the result:

ContainsOperator

xpCollection1.Filter = new ContainsOperator("Addresses", new BinaryOperator("City", "Chicago"));
//or
xpCollection1.Filter = CriteriaOperator.Parse("[Addresses][[City] = ?]", "Chicago");
See Also