title: Filtering in Silverlight with RIA Services
body: <p>I have a small SL application that uses RIA services to display employee data (Northwind database) in a data grid. I have a text filter, that works fine against varchar columns but does not filter against a nullable int column. Here is the xaml:</p>
  
  <pre><code>&lt;UserControl xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria" 
           xmlns:riaData="clr-namespace:System.Windows.Data;assembly=System.Windows.Controls.Ria"  
           xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" x:Class="FilteringSample.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:web="clr-namespace:FilteringSample.Web"
  xmlns:converter="clr-namespace:FilteringSample"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"&gt;
  &lt;UserControl.Resources&gt;
      &lt;converter:StringToIntConverter x:Key="MyConverter"&gt;&lt;/converter:StringToIntConverter&gt;
  &lt;/UserControl.Resources&gt;
      &lt;Grid x:Name="LayoutRoot"&gt;
  &lt;StackPanel Orientation="Vertical" Height="Auto" Grid.Column="0"&gt;
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;Button x:Name="saveButton" Width="75" Height="30" Content="Save" Margin="5" Click="saveButton_Click"/&gt;
              &lt;Button x:Name="rejectButton" Width="75" Height="30" Content="Reject" Margin="5" Click="rejectButton_Click"/&gt;
              &lt;TextBlock x:Name="changeText" VerticalAlignment="Center" Width="Auto"/&gt;
              &lt;TextBox x:Name="Filter" Width="100" Text="" /&gt;
              &lt;riaControls:DomainDataSource x:Name="DataSource1" QueryName="GetEmployeesQuery" LoadingData="DataSource1_LoadingData"   &gt;
                  &lt;riaControls:DomainDataSource.DomainContext&gt;
                      &lt;!--&lt;web:CustomerContext&gt;&lt;/web:CustomerContext&gt;--&gt;
                      &lt;web:EmployeeContext&gt;&lt;/web:EmployeeContext&gt;
                  &lt;/riaControls:DomainDataSource.DomainContext&gt;
  
                  &lt;riaControls:DomainDataSource.FilterDescriptors&gt;
                      &lt;riaData:FilterDescriptorCollection LogicalOperator="Or"&gt;                                                
                          &lt;riaData:FilterDescriptor PropertyPath="FirstName" Operator="Contains"&gt;
                              &lt;riaControls:ControlParameter ControlName="Filter" PropertyName="Text" RefreshEventName="TextChanged" /&gt;
                          &lt;/riaData:FilterDescriptor&gt;
                          &lt;riaData:FilterDescriptor PropertyPath="Title" Operator="Contains"&gt;
                              &lt;riaControls:ControlParameter ControlName="Filter" PropertyName="Text" RefreshEventName="TextChanged" /&gt;
                          &lt;/riaData:FilterDescriptor&gt;
                          &lt;riaData:FilterDescriptor PropertyPath="TestFilter" Operator="Contains"&gt;
                              &lt;riaControls:ControlParameter ControlName="Filter" PropertyName="Text" RefreshEventName="TextChanged"/&gt;
                          &lt;/riaData:FilterDescriptor&gt;
  
                      &lt;/riaData:FilterDescriptorCollection&gt;
                  &lt;/riaControls:DomainDataSource.FilterDescriptors&gt;
              &lt;/riaControls:DomainDataSource&gt;
  
          &lt;/StackPanel&gt;
          &lt;data:DataGrid Name="MyGrid" ItemsSource="{Binding Data, ElementName=DataSource1}"&gt;
          &lt;/data:DataGrid&gt;
          &lt;!--&lt;data:DataPager PageSize="20" Source="{Binding Data, ElementName=DataSource1}" Margin="0,-1,0,0" /&gt;--&gt; 
      &lt;/StackPanel&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>Any help will be appreciated.
  Thanks</p>