title: How to cope with a observable collection binded datagrid with manual update
body: <p>I have a datagrid </p>
  
  <pre><code>&lt;DataGrid Name="dtgFeatures" Height="100" Margin="10" ColumnWidth="*" CanUserAddRows="True" MouseLeftButtonUp="DtgFeatures_MouseLeftButtonUp"/&gt;
  </code></pre>
  
  <p>which is binded to an observable collection</p>
  
  <pre><code>ObservableCollection&lt;CfgPartPrograms&gt; obcCfgPartPrograms = new ObservableCollection&lt;CfgPartPrograms&gt;();
  </code></pre>
  
  <p>with</p>
  
  <pre><code>[Serializable]
  public class CfgPartPrograms
  {
      public CfgPartPrograms() { }
      public string Group{ get; set;}
      public string Description{ get; set;}
      public string Filename{ get; set;}&lt;------set with openfiledialog
      public string Notes{ get; set;}
  }
  </code></pre>
  
  <p>Now since I want to be able to insert the filename with an openfileDialog I have add this code:</p>
  
  <pre><code>private void DtgFeatures_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  {
      int column = (sender as DataGrid).CurrentCell.Column.DisplayIndex;
      if ( column == 2)
      {
          OpenFileDialog ofdPP = new OpenFileDialog();
          if (ofdPP.ShowDialog() == true)
          {
              if (obcCfgPartPrograms.Count == 0)
                  obcCfgPartPrograms.Add(new CfgPartPrograms() { Filename = ofdPP.FileName });
              else
                  obcCfgPartPrograms[selectedIndex].Filename = ofdPP.FileName;
              dtgFeatures.ItemsSource = null;
              dtgFeatures.ItemsSource = obcCfgPartPrograms;
          }
      }
  </code></pre>
  
  <p>the problem is that when I set the filename the observable collection has not been updated yet.
  I'll explain that with images:</p>
  
  <p><a href="https://i.stack.imgur.com/3AT9o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3AT9o.png" alt="enter image description here"></a> </p>
  
  <p>So I have added aaaa and bbb now I want to force the filename with the code above but when I do that the bind action has not been done yet on the observable collection so that aaaa and bbbb are not present.</p>
  
  <p><a href="https://i.stack.imgur.com/WnvCZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WnvCZ.png" alt="enter image description here"></a></p>
  
  <p>In short how to tell the binded datagrid to update the binding??</p>
  
  <p>Thanks in advance
  Patrick</p>