Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FilterDescriptor Class

WCF RIA Services

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Represents a filter description for query operations in a DomainDataSource object.


Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)

public class FilterDescriptor : DependencyObject

The FilterDescriptor type exposes the following members.

Public methodFilterDescriptor()Initializes a new instance of the FilterDescriptor class with default values.
Public methodFilterDescriptor(String, FilterOperator, Object)Initializes a new instance of the FilterDescriptor class with the specified property to use for filtering, the operator to use when evaluating the filtering check, and the filter value.

Public propertyDispatcher (Inherited from DependencyObject.)
Public propertyIgnoredValueGets or sets the value that is not applied to a query operation for filtering.
Public propertyIsCaseSensitiveGets or sets a value indicating whether the FilterDescriptor is case sensitive for string values.
Public propertyOperatorGets or sets the filter operator.
Public propertyPropertyPathGets or sets the name of the property path used as the data value to assess whether the entity meets the filter check.
Public propertyValueGets or sets the value to use for evaluating the filter condition.

Public methodCheckAccess (Inherited from DependencyObject.)
Public methodClearValue (Inherited from DependencyObject.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetAnimationBaseValue (Inherited from DependencyObject.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodGetValue (Inherited from DependencyObject.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodReadLocalValue (Inherited from DependencyObject.)
Public methodSetValue (Inherited from DependencyObject.)
Public methodToString (Inherited from Object.)

Public fieldStatic memberDefaultIgnoredValueThe default value of the IgnoredValue property.
Public fieldStatic memberIgnoredValuePropertyIdentifies the IgnoredValue dependency property.
Public fieldStatic memberIsCaseSensitivePropertyIdentifies the IsCaseSensitive dependency property.
Public fieldStatic memberOperatorPropertyIdentifies the Operator dependency property.
Public fieldStatic memberPropertyPathPropertyIdentifies the PropertyPath dependency property.
Public fieldStatic memberValuePropertyIdentifies the Value dependency property.

The DomainDataSource control provides the FilterDescriptors collection to enable you to filter the data that is returned by the query. By adding filters, you can specify that only entities which meet the condition in the filter are loaded from the domain context. You define the logical relationship between different filters by setting the FilterOperator property on the DomainDataSource object. The FilterOperator property supports any value in the FilterDescriptorLogicalOperator enumerator.Within a FilterDescriptor instance, you set the Operator property to specify the type of comparison to use when filtering. Filter descriptors support the operations in the FilterOperator enumerator.

The following example shows two filter descriptors that are connected by a logical AND statement. One filter depends on user input and one filter is specified in the declarative syntax.

<Grid x:Name="LayoutRoot" Background="White">  
        <RowDefinition Height="25" />
        <RowDefinition Height="Auto" />
    <riaControls:DomainDataSource x:Name="source" QueryName="GetProducts" AutoLoad="true">
            <domain:ProductDomainContext />
            <riaData:FilterDescriptorCollection LogicalOperator="And">
              <riaData:FilterDescriptor PropertyPath="Color" Operator="IsEqualTo" Value="Blue" />
              <riaData:FilterDescriptor PropertyPath="ListPrice" Operator="IsLessThanOrEqualTo">
                      RefreshEventName="SelectionChanged" />
    <ComboBox x:Name="MaxPrice" Grid.Row="0" Width="60" SelectedIndex="0">
        <ComboBoxItem Content="100" />
        <ComboBoxItem Content="500" />
        <ComboBoxItem Content="1000" />
    <data:DataGrid Grid.Row="1" ItemsSource="{Binding Data, ElementName=source}" />

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2017 Microsoft