title: Multiple Filters not working in DataGrid WPF
body: <p>My Databinding works fine in my DataGrid, but when I try to get the collectionview from my CollectionViewSource, it is null, and my filter in DataGrid does not work.  Here is the code:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;CollectionViewSource x:Key="jobItemViewSource" d:DesignSource="{d:DesignInstance my:JobItem, CreateList=True}"/&gt;
  &lt;/Window.Resources&gt;
  
  &lt;Grid Visibility="Visible" ShowGridLines="False" UseLayoutRounding="True" DataContext="{StaticResource jobItemViewSource}"&gt;
  
  &lt;DataGrid Grid.Row="4" Grid.ColumnSpan="6" LoadingRow="jobItemDataGrid_LoadingRow" ItemsSource="{Binding}" Name="jobItemDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" IsReadOnly="True" IsSynchronizedWithCurrentItem="True" AutoGenerateColumns="False" Grid.RowSpan="2"&gt;
                      &lt;DataGrid.Columns&gt;
                          &lt;DataGridTextColumn x:Name="workOrderNoColumn" Binding="{Binding Path=WorkOrderNo}" Header="Work Order No." Width="75" /&gt;
                          &lt;DataGridTextColumn x:Name="assigneeColumn" Binding="{Binding Path=PrimaryAssignee}" Header="Assignee" Width="80" /&gt;
                          &lt;DataGridTextColumn x:Name="dateReceivedColumn" Binding="{Binding Path=DateReceived}" Header="Date Received" Width="90" /&gt;
                          &lt;DataGridTextColumn x:Name="dueDateColumn" Binding="{Binding Path=DueDate}" Header="Due Date" Width="90" /&gt;
                          &lt;DataGridTextColumn x:Name="statusColumn" Binding="{Binding Path=Status}" Header="Status" Width="70" /&gt;
                      &lt;/DataGrid.Columns&gt;
  
                  &lt;/DataGrid&gt;
  &lt;CheckBox Content="Show Active Jobs" Name="actJobsCheckBox" Grid.Column="1" Grid.ColumnSpan="2"  Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Checked="AddFiltering" Unchecked="RemoveFiltering"/&gt;
                  &lt;CheckBox Content="Show Completed Jobs" Name="compJobsCheckBox" Grid.Column="3" Grid.ColumnSpan="3"  Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Checked="AddFiltering" Unchecked="RemoveFiltering"/&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p>In my code behind, I have the following:</p>
  
  <pre><code>public partial class AdminView : Window
  {
      ObservableCollection &lt;JobItem&gt; JobItemList = new ObservableCollection&lt;JobItem&gt;();
      CollectionViewSource jobItemViewSource = new CollectionViewSource();
      ICollectionView view; 
      MainWindow parent;
      Employee currEmployee;
      GroupFilter filterList = new GroupFilter();
  
      public AdminView(MainWindow parent, Employee currEmployee)
      {
          this.parent = parent;
          this.currEmployee = currEmployee;
          InitializeComponent();
          jobItemDataGrid.DataContext = JobItemList;
          jobItemViewSource = (CollectionViewSource)(this.Resources[jobItemViewSource]);
          view = CollectionViewSource.GetDefaultView(jobItemDataGrid);
  
  
      }
  
  private void AddFiltering(object sender, RoutedEventArgs args)
      {
          CheckBox check = sender as CheckBox;
          Predicate&lt;object&gt; active = new Predicate&lt;object&gt;(ContainsActive);
          Predicate&lt;object&gt; completed = new Predicate&lt;object&gt;(ContainsComp);
  
          switch (check.Name)
          {
              case "actJobsCheckBox":
                  filterList.AddFilter(active);
                  if( view != null)
                      view.Filter = filterList.Filter;
                  break;
              case "compJobsCheckBox":
                  filterList.AddFilter(completed);
                  if (view != null)
                      view.Filter = filterList.Filter;
                  break;
          }
  
  
      }
  
      private void RemoveFiltering(object sender, RoutedEventArgs args)
      {
          CheckBox check = sender as CheckBox;
          Predicate&lt;object&gt; active = new Predicate&lt;object&gt;(ContainsActive);
          Predicate&lt;object&gt; completed = new Predicate&lt;object&gt;(ContainsComp);
  
          switch (check.Name)
          {
              case "actJobsCheckBox":
                  filterList.RemoveFilter(active);
                  break;
              case "compJobsCheckBox":
                  filterList.RemoveFilter(completed);
                  break;
          }
  
      }
  
      public bool ContainsActive(object de)
      {
          JobItem item = de as JobItem;
  
          return (item.Status != "Completed");
      }
  
      public bool ContainsComp(object de)
      {
          JobItem item = de as JobItem;
  
          return (item.Status == "Completed");
      }
  </code></pre>