Export (0) Print
Expand All

FilterOperator Enumeration

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

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)

public enum class FilterOperator

Member nameDescription
IsLessThanThe data value must be smaller than the filter value.
IsLessThanOrEqualToThe data value must be smaller than or equal to the filter value.
IsEqualToThe data value must be equal to the filter value.
IsNotEqualToThe data value must be different from the filter value.
IsGreaterThanOrEqualToThe data value must be larger than or equal to the filter value.
IsGreaterThanThe data value must be larger than the filter value.
StartsWithThe data value must start with the filter value.
EndsWithThe data value must end with the filter value.
ContainsThe data value must contain the filter value.
IsContainedInThe data value must be contained in the filter value.

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

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>


Show:
© 2014 Microsoft