Back to Devexpress

XPServerCollectionSource.FixedFilterString Property

xpo-devexpress-dot-xpo-dot-xpservercollectionsource-4be29483.md

latest4.4 KB
Original Source

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

NuGet Package : DevExpress.Xpo

Declaration

csharp
[Browsable(false)]
[DefaultValue("")]
public string FixedFilterString { get; set; }
vb
<Browsable(False)>
<DefaultValue("")>
Public Property FixedFilterString As String

Property Value

TypeDefaultDescription
StringString.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.

  • C#

  • VB.NET

csharp
using DevExpress.Xpo;

XPServerCollectionSource gridDataSource;
// ...
gridDataSource.FixedFilterString = "([FirstName]='Amanda') AND ([LastName] Like 'C%')";
vb
Imports DevExpress.Xpo

Dim gridDataSource As XPServerCollectionSource 
' ...
gridDataSource.FixedFilterString = "([FirstName]='Amanda') AND ([LastName] Like 'C%')"

See Also

XPServerCollectionSource Class

XPServerCollectionSource Members

DevExpress.Xpo Namespace