Skip to main content

ContainsOperator Class

An operator which checks if a collection contains at least one object matching a specific criteria.

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v21.2.dll


public sealed class ContainsOperator :


The ContainsOperator operator can be used to filter the contents of the XPCollection.

It’s also possible to use the CriteriaOperator.Parse method to create a CriteriaOperator operator for a specific expression.


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:


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

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


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.


See Also