XPServerCollectionSource.FixedFilterString Property
Gets or sets an expression in a string format, used to filter objects on the data store side. This filter is 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 | Default | Description |
---|---|---|
String | String.Empty | A string that specifies the filter expression applied to data on the data server side. |
Remarks
You can use the FixedFilterString property to filter data using specific criteria. For information on the syntax for creating filter expressions, see the BinaryOperatorType, FunctionOperatorType, GroupOperatorType and UnaryOperatorType topics.
It’s also possible to specify filter criteria via the XPServerCollectionSource.FixedFilterCriteria property, which accepts a CriteriaOperator object. The FixedFilterString and XPServerCollectionSource.FixedFilterCriteria properties are synchronized. When a filter expression is assigned to the FixedFilterString property, an equivalent CriteriaOperator object is created and assigned to the XPServerCollectionSource.FixedFilterCriteria property. When a new CriteriaOperator object is assigned to the XPServerCollectionSource.FixedFilterCriteria property, the FixedFilterString property is also modified. It will return an equivalent string expression for the specified criteria.
Filters can only be created using properties identified by the descriptive object whose type is assigned to the XPServerCollectionSource object. Other properties cannot be utilized in filter expressions.
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 FixedFilterString property, and vice versa.
Example
The following code shows how to specify a filter for a XPServerCollectionSource object via its XPServerCollectionSource.FixedFilterString
property. The filter created selects records which:
- contain ‘Amanda’ in the FirstName column;
- contain values starting with ‘C’ in the LastName column.
using DevExpress.Xpo;
XPServerCollectionSource gridDataSource;
// ...
gridDataSource.FixedFilterString = "([FirstName]='Amanda') AND ([LastName] Like 'C%')";