XPServerCollectionSource.FixedFilterCriteria Property
Gets or sets the criteria used to filter objects on the data store side. These criteria are never affected by the data-aware control that is bound to the current XPServerCollectionSource object.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.1.dll
NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap, DevExpress.Xpo
NuGet Package: DevExpress.Xpo
Declaration
Property Value
Type | Description |
---|---|
CriteriaOperator | A CriteriaOperator object that specifies the criteria to filter objects on the data store side. |
Remarks
You can use the FixedFilterCriteria property to filter data using specific criteria. To filter data, create a CriteriaOperator object and assign it to the FixedFilterCriteria property.
For examples and additional information about filter expressions, see these help topics:
- How to: Build Simple Criteria
- How to: Build Complex Criteria
- Build Criteria - Cheat Sheet
- Filtering
- Criteria Language Syntax
It’s also possible to specify filter criteria in a string format via the XPServerCollectionSource.FixedFilterString property. The FixedFilterCriteria and XPServerCollectionSource.FixedFilterString properties are synchronized. When a filter expression is assigned to the XPServerCollectionSource.FixedFilterString property, an equivalent CriteriaOperator object is created and assigned to the FixedFilterCriteria property. When a new CriteriaOperator object is assigned to the FixedFilterCriteria property, the XPServerCollectionSource.FixedFilterString property is also modified. It will return an equivalent string expression for the specified criteria.
A data-aware control that is bound to an XPServerCollectionSource object can provide its own filter criteria. Changing the filter via the data-aware control doesn’t modify the FixedFilterCriteria property and vice versa.
Example
The following example creates a filter and applies it to a XPServerCollectionSource object via the XPServerCollectionSource.FixedFilterCriteria
property.
The filter selects records which match the following conditions
- contain values starting with ‘A’ in the LastName column;
- contain dates greater than Jan 1, 2003 in the ModifiedDate column.
using DevExpress.Xpo;
using DevExpress.Data.Filtering;
XPServerCollectionSource gridDataSource;
// ...
gridDataSource.FixedFilterCriteria = CriteriaOperator.Parse(
"([LastName] LIKE ?) AND ([ModifiedDate] > ?)",
"A%", DateTime.Parse("1/1/2003"));