title: How to properly bind datagrid and textboxes and only update the datagrid after clicking a button?
body: <p>I have WPF app and having trouble with binding. My UI looks like the image on the link. (My apologies for not embedding the image since I'm a new user and need to gain points in order to post image)</p>
  
  <p><a href="http://i.stack.imgur.com/a1koN.jpg" rel="nofollow">http://i.stack.imgur.com/a1koN.jpg</a></p>
  
  <p>Basically 1 Product can have many Pricing Details. The screen is for the Edit mode where the information is retrieved from the database (for the sake of this sample, I just hard coded the values). Selecting an item in the <code>datagrid</code> will load the information on its respective textboxes. This is currently working fine. The only thing that i would like to modify is the behavior when changing the value in  the textbox because the <code>datagrid</code> gets immediately updated. Would it be possible to only update the datagrid once the <code>EDIT</code> button is clicked? Note that any changes made in this point is not yet persisted in the database, it would only be persisted when the <code>UPDATE</code> button(on the top) is clicked.</p>
  
  <p>Here's the snippet of the XAML file:</p>
  
  <p><strong>DataGrid</strong></p>
  
  <pre><code>&lt;DataGrid AutoGenerateColumns="False" AlternationCount="2" Height="100" ItemsSource="{Binding ProductPrices, Mode=TwoWay}" SelectedItem="{Binding ProductPrice}" IsReadOnly="True" SelectionMode="Single" GridLinesVisibility="Horizontal"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Binding="{Binding UnitPrice, StringFormat=\{0:N\}}" Header="Unit Price" Width="100" /&gt;
          &lt;DataGridTextColumn Binding="{Binding LowestPrice, StringFormat=\{0:N\}}" Header="Lowest Price" Width="100"/&gt;
          &lt;DataGridTextColumn Binding="{Binding EffectiveDate, StringFormat=\{0:d\}}" Header="Effective Date" Width="150"/&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p><strong>TextBoxes</strong></p>
  
  <pre><code>&lt;TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Path=ProductPrice.UnitPrice, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=\{0:N\}}" Width="100" /&gt;
  &lt;TextBox Grid.Column="3" Grid.Row="0" Text="{Binding Path=ProductPrice.LowestPrice, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=\{0:N\}}" Width="100" /&gt;
  &lt;DatePicker Grid.Column="1" Grid.Row="1" Text="{Binding Path=ProductPrice.EffectiveDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" Width="100" /&gt;
  </code></pre>
  
  <p><strong>ViewModel</strong></p>
  
  <pre><code>    private Product _product;
      public Product Product
      {
          get { return _product; }
          set
          {
              _product = value;
              NotifyPropertyChanged(m =&gt; m.Product);
          }
      }
  
      private ProductPrice _productPrice;
      public ProductPrice ProductPrice
      {
          get { return _productPrice; }
          set
          {
              _productPrice = value;
              NotifyPropertyChanged(m =&gt; m.ProductPrice);
          }
      }
  
      private ObservableCollection&lt;ProductPrice&gt; _productPrices;
      public ObservableCollection&lt;ProductPrice&gt; ProductPrices
      {
          get { return _productPrices; }
          set
          {
              _productPrices = value;
              NotifyPropertyChanged(m =&gt; m.ProductPrices);
          }
      }
  </code></pre>
  
  <p><code>UpdateSourceTrigger=PropertyChanged</code> must be the culprit. But I still don't have an idea on how to solve this case. Is this achievable using <code>MVVM</code> approach?</p>
  
  <p>I had uploaded the source code on <a href="https://skydrive.live.com/?cid=974337211B5F9E8B&amp;id=974337211B5F9E8B!109" rel="nofollow">SkyDrive</a></p>