title: Filtering ObservableCollection in WPF MVVM
body: <p>I have a data-grid which is bind ObservableCollection. There is an Status field. 
  I need to Filter by status when click on filter button. I use MVVM and need to filter inside the VM class.</p>
  
  <pre><code>&lt;DataGrid
      CanUserResizeColumns="False" CanUserResizeRows="False" IsEnabled="{Binding IsKeySet}"
      Name="dgwTemplateDetails" CanUserAddRows="False" SelectionMode="Single"
      ItemsSource="{Binding OrderTemplateList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
      AutoGenerateColumns="False" Width="auto" FontWeight="Normal" FontStyle="Normal"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Header="Act Code" Width="75" Binding="{Binding ActCode}" IsReadOnly="True"/&gt;
          &lt;DataGridTextColumn Header="Act Name" Width="*" Binding="{Binding ActName}" IsReadOnly="True"/&gt;
          &lt;DataGridTextColumn Header="No. Of Days" Width="80" Binding="{Binding NoOfDays}"/&gt;
          &lt;DataGridTemplateColumn Header="To be Finish Date" Width="110" IsReadOnly="True"&gt;
              &lt;DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock Text="{Binding EarStartDt, StringFormat=dd/MM/yyyy, UpdateSourceTrigger=PropertyChanged}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellTemplate&gt;
              &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;DatePicker SelectedDate="{Binding EarStartDt, StringFormat=dd/MM/yyyy, UpdateSourceTrigger=PropertyChanged}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
          &lt;/DataGridTemplateColumn&gt;
          &lt;DataGridTextColumn Header="Act Status" Width="100" Binding="{Binding ActStatus}" IsReadOnly="True"/&gt;
          &lt;DataGridTextColumn Header="Remarks" Width="200" Binding="{Binding Remarks}" IsReadOnly="True"/&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>