ContainsOperator(String, CriteriaOperator) Constructor
In This Article
Initializes a new instance of the ContainsOperator class with the specified property and criteria expression.
Namespace: DevExpress.Data.Filtering
Assembly: DevExpress.Data.v24.2.dll
NuGet Package: DevExpress.Data
#Declaration
public ContainsOperator(
string collectionProperty,
CriteriaOperator condition
)
#Parameters
Name | Type | Description |
---|---|---|
collection |
String | A String value which identifies the property whose values will be searched. |
condition | Criteria |
A 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:
xpCollection1.Filter = new ContainsOperator("Addresses", new BinaryOperator("City", "Chicago"));
//or
xpCollection1.Filter = CriteriaOperator.Parse("[Addresses][[City] = ?]", "Chicago");
See Also