title: How can I get the updates in view model when data changes in a grid bound to an Observable Collection<T> in WPF
body: <p>I have a few combo boxes and columns bound to a grid, when the user 
      changes the selection in the combo box or edits a field. I would like 
       to capture the changes in my view model. The grid is bound to an 
       ObservableCollection </p>
  
  <p>T has INotifyPropertyChanged, and currently I am capturing the changes 
       in the class T</p>
  
  <pre><code>&lt;c1:C1FlexGrid 
      Name="grdInteractions" 
      ItemsSource="{Binding Interactions, Mode=TwoWay}"
      &gt;
      &lt;c1:C1FlexGrid.Columns&gt;
          &lt;c1:Column 
              Width="80" 
              Header="Code"  
              ColumnName="InteractionCode" 
              HorizontalAlignment="Left" 
              IsReadOnly="true"
              Binding="{Binding Parent}" 
              /&gt;
          &lt;c1:Column 
              Width="65" Header="Strategy"
              &gt;
              &lt;c1:Column.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;ComboBox 
                          Name="cbStrategy" 
                          DisplayMemberPath="StrategyDesc" 
                          SelectedValuePath="StrategyCode" 
                          ItemsSource="{Binding Strategies}" 
                          SelectedItem="{Binding StrategyItem, Mode=TwoWay}"
                          /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/c1:Column.CellTemplate&gt;
          &lt;/c1:Column&gt;
      &lt;/c1:C1FlexGrid.Columns&gt;
  &lt;/c1:C1FlexGrid&gt;
  </code></pre>
  
  <p>C#</p>
  
  <pre><code>public class Interaction : INotifyPropertyChanged
  {
      public string InteractionCode { get; set; }
      public List&lt;Strategy&gt; Strategies
      {
          get
          {
              return _strategies;
          }
          set
          {
              _strategies = value;
          }
      }
      public Strategy StrategyItem
      {
          get
          {
              return _strategyItem;
          }
          set
          {
              _strategyItem = value;
              OnPropertyChanged("StrategyItem");
          }
      }
  }
  </code></pre>