title: Find Items in ObservableCollection and update UI
body: <p>So, I'm at a lost, and hope for some guidance. I'm using MVVM pattern and EF.</p>
  
  <p>My View contains a datagrid bound to a observable collection within the view model. 
  The UI has furthermore 3 comboboxes with possible data to minimize the data shown. </p>
  
  <p>So I've been googling around and found nothing I could use (or might not have understood it correctly). </p>
  
  <p>How do I search and select the items from a ObservableCollection, and update the datagrid accordingly? </p>
  
  <pre><code>    public ObservableCollection&lt;DimTargets&gt; TargetParameters { get; set; }
      private void SelectionChanged(object obj)
      {
          if (obj is FactTargets)
          {
              SelectedFactTarget = (FactTargets)obj;
          }
          else if (obj is DimLocation)
          {
              SelectedLocation = (DimLocation)obj;
              ViewCollection.Select(x =&gt; x.Location == SelectedLocation.Location);
              TargetParameters.Where(x =&gt; x.FactTargets == SelectedLocation.FactTargets);
          }
          else //DimBladeType
          {
              SelectedBladeType = (DimBladeType)obj;
              int[] a = DimTargetsController.ReturnBladeType(SelectedBladeType);
              foreach (int i in a)
              {
                  TargetParameters.Single(k =&gt; k.ID == i);
              }
              var os = TargetParameters.Where(d =&gt; d.ID == );
              TargetParameters = Convert&lt;DimTargets&gt;(os);
              //TargetParameters.Where(ka =&gt; ka.ID == a);
              //TargetParameters = new ObservableCollection&lt;DimTargets&gt;(TargetParameters.Where(t =&gt; t.FactTargets == SelectedBladeType.FactTargets));
              //var obs = TargetParameters.Where(t =&gt; t.FactTargets == SelectedBladeType.FactTargets);
              //TargetParameters = Convert&lt;DimTargets&gt;(obs);
              //ViewCollection.Select(x =&gt; x.BladeType == SelectedBladeType.BladeType).ToList();
          }
      }
  
      public ObservableCollection&lt;T&gt; Convert&lt;T&gt;(IEnumerable original)
      {
          return new ObservableCollection&lt;T&gt;(original.Cast&lt;T&gt;());
      }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code> ComboBox ItemsSource="{Binding FactTargetCollection, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding SelectedFactTarget}" DisplayMemberPath="FYQuater" Behaivor:SelectionChangedBehaviour.Command="{Binding SelectionChangedCommand}"/&gt;
              &lt;ComboBox ItemsSource="{Binding LocationCollection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding SelectedLocation}" DisplayMemberPath="Location" Behaivor:SelectionChangedBehaviour.Command="{Binding SelectionChangedCommand}"/&gt;
              &lt;ComboBox ItemsSource="{Binding BladeTypeCollection, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding SelectedBladeType}" DisplayMemberPath="BladeType" Behaivor:SelectionChangedBehaviour.Command="{Binding SelectionChangedCommand}"/&gt;
  
              &lt;Button Content="Submit" Style="{StaticResource BaseButtonStyle}"&gt;&lt;/Button&gt;
          &lt;/StackPanel&gt;
  
          &lt;StackPanel x:Name="WorkPanel" DockPanel.Dock="Right"&gt;
              &lt;DataGrid ItemsSource="{Binding TargetParameters}"&gt;
  
              &lt;/DataGrid&gt;
          &lt;/StackPanel&gt;`
  </code></pre>
  
  <p>Hope this gives a better idea of what i'm trying to do.
  the c# code are filled with examples with what i've tried.</p>