xpo-devexpress-dot-xpo-dot-xpservercollectionsource-0f7888a0.md
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.v25.2.dll
NuGet Package : DevExpress.Xpo
public CriteriaOperator FixedFilterCriteria { get; set; }
Public Property FixedFilterCriteria As CriteriaOperator
| Type | Description |
|---|---|
| CriteriaOperator |
A CriteriaOperator object that specifies the criteria to filter objects on the data store side.
|
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:
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.
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"));
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Dim gridDataSource As XPServerCollectionSource
' ...
gridDataSource.FixedFilterCriteria = CriteriaOperator.Parse( _
"([LastName] LIKE ?) AND ([ModifiedDate] > ?)", _
"A%", DateTime.Parse("1/1/2003"))
See Also
XPServerCollectionSource Class