FilterOperator Enumeration

[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.]

Defines values that describe the operators used in the FilterDescriptor class.

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

Syntax

'Declaration
Public Enumeration FilterOperator
'Usage
Dim instance As FilterOperator
public enum FilterOperator
public enum class FilterOperator
type FilterOperator
public enum FilterOperator

Members

Member name Description
IsLessThan The data value must be smaller than the filter value.
IsLessThanOrEqualTo The data value must be smaller than or equal to the filter value.
IsEqualTo The data value must be equal to the filter value.
IsNotEqualTo The data value must be different from the filter value.
IsGreaterThanOrEqualTo The data value must be larger than or equal to the filter value.
IsGreaterThan The data value must be larger than the filter value.
StartsWith The data value must start with the filter value.
EndsWith The data value must end with the filter value.
Contains The data value must contain the filter value.
IsContainedIn The data value must be contained in the filter value.

Remarks

You apply a FilterOperator value to the Operator property in the FilterDescriptor class.

Examples

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

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

See Also

Reference

System.Windows.Controls Namespace