.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
A newer version of this page is available. Switch to the current version.

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.v19.2.dll

Declaration

[TypeConverter("DevExpress.Xpo.Design.CriteriaEditor, DevExpress.Xpo.v19.2.Design, Version=19.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")]
public CriteriaOperator FixedFilterCriteria { get; set; }
<TypeConverter("DevExpress.Xpo.Design.CriteriaEditor, DevExpress.Xpo.v19.2.Design, Version=19.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")>
Public Property FixedFilterCriteria As CriteriaOperator

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:

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.

Examples

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")); 
See Also