Edit this page

Filtering through RadDataFilter

If you bind RadDataFilter.Source to RadDataServiceDataSource.DataView, you will get automatic server-side filtering. When the user defines his filtering criteria through RadDataFilter’s UI, RadDataFilter will automatically transfer the resulting FilterDescriptors to RadDataServiceDataSource. If RadDataServiceDataSource.AutoLoad is true, the control will automatically go to the server and get the data that matches these FilterDescriptors.

<Grid x:Name="LayoutRoot" Background="White">
 <Grid.RowDefinitions>
  <RowDefinition Height="Auto"/>
  <RowDefinition Height="*"/>
 </Grid.RowDefinitions>
 <telerik:RadDataServiceDataSource Name="customersDataSource" QueryName="Customers" AutoLoad="True">
  <telerik:RadDataServiceDataSource.DataServiceContext>
   <local:MyNorthwindContext/>
  </telerik:RadDataServiceDataSource.DataServiceContext>
 </telerik:RadDataServiceDataSource>
 <telerik:RadDataFilter Grid.Row="0" Source="{Binding DataView, ElementName=customersDataSource}"/>
 <telerik:RadGridView Grid.Row="1" ItemsSource="{Binding DataView, ElementName=customersDataSource}" 
    IsBusy="{Binding IsBusy, ElementName=customersDataSource}" 
    ShowGroupPanel="False"/> 
</Grid>

On running the application, you may perform the following:

If AutoLoad is false, the descriptors will be transferred to RadDataServiceDataSource, but no trip to the server will be made until the Load method is called.