title: Update DataGrid cell if other cell changes
body: <p>I have a View that displays a Part. All parts contain a list of identifiers. In my View I display Part Properties and a DataGrid with all the Identifiers of that part.</p>
  
  <p>Now if I change a value of an identifier, I want another value update to the default. But if I change my identifier value and set the default of the other property - my DataGrid does not update. Only if I click on the cell, then it gets updated after losing focus.</p>
  
  <p>How can I update the View automatically?</p>
  
  <p>I guess the problem is that I do not want to update a direct property of the Part, but a Property in a List that is a property of the Part.</p>
  
  <p>View</p>
  
  <pre><code>&lt;DataGrid&gt;
      &lt;DataGridTemplateColumn Header="Company"&gt;
          &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
               &lt;DataTemplate&gt;
                    &lt;ComboBox x:Name="CompanyEditComboBox" 
                              ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=DataContext.Companies}" 
                              SelectedItem="{Binding Company, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                             SelectionChanged = "CompanyEditComboBox_SelectionChanged" /&gt;
              &lt;/DataTemplate&gt;
           &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
           &lt;DataGridTemplateColumn.CellTemplate&gt;
              &lt;DataTemplate&gt;
                   &lt;TextBlock Text="{Binding Company}" /&gt;
              &lt;/DataTemplate&gt;
           &lt;/DataGridTemplateColumn.CellTemplate&gt;
       &lt;/DataGridTemplateColumn&gt;
  
  
      &lt;DataGridTemplateColumn Header="CompanyType"&gt;
           &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                &lt;DataTemplate&gt;
                      &lt;ComboBox x:Name="CompanyTypeEditComboBox" 
                                        ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=DataContext.CompanyTypes}" 
                                        SelectedItem="{Binding IdentificationCompanyType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /&gt;
                &lt;/DataTemplate&gt;
            &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
            &lt;DataGridTemplateColumn.CellTemplate&gt;
                &lt;DataTemplate&gt;
                   &lt;TextBlock Text="{Binding IdentificationCompanyType, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" /&gt;
                &lt;/DataTemplate&gt;
            &lt;/DataGridTemplateColumn.CellTemplate&gt;
         &lt;/DataGridTemplateColumn&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>View Code-Behind</p>
  
  <pre><code>private void CompanyEditComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  {
      var vm = (PartViewModel)DataContext;
      var box = (ComboBox) sender;
      var c = (Company) box.SelectedItem;
      vm.SetDefaultCompanyType(c);
  }
  </code></pre>
  
  <p>ViewModel</p>
  
  <pre><code>public void SetDefaultCompanyType(Company c)
  {
      SelectedIdentification.IdentificationCompanyType = c.DefaultCompanyType;
      OnPropertyChanged("IdentificationCompanyType");
  }
  </code></pre>