DomainDataSource.FilterDescriptors Property
[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.]
Gets the collection of FilterDescriptor objects used when performing loads.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)
Syntax
'Declaration
Public Property FilterDescriptors As FilterDescriptorCollection
Get
Private Set
'Usage
Dim instance As DomainDataSource
Dim value As FilterDescriptorCollection
value = instance.FilterDescriptors
public FilterDescriptorCollection FilterDescriptors { get; private set; }
public:
property FilterDescriptorCollection^ FilterDescriptors {
FilterDescriptorCollection^ get ();
private: void set (FilterDescriptorCollection^ value);
}
member FilterDescriptors : FilterDescriptorCollection with get, private set
function get FilterDescriptors () : FilterDescriptorCollection
private function set FilterDescriptors (value : FilterDescriptorCollection)
Property Value
Type: System.Windows.Controls.FilterDescriptorCollection
The collections of filters that are applied to the data set.
Examples
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">
<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