title: How to get Old value of a cell in Datagridview after programmatic setting of cell value?
body: <p>I am trying to retrieve old value of edited <code>Datagridview</code> cell so that I can allow user to undo the changes. The cell value which is edited is done <strong>programmatically</strong> (without typing into the cell). Below is the code I am using for editing the cell value (however the actual implementation is in <code>LabVIEW</code>):</p>
  
  <pre><code>dataGridView1[1,1].Value = "New Value";
  </code></pre>
  
  <p>I've been using <code>CellBeginEdit</code> event to capture old values of a cell if user is typing value in a cell. and it works fine. but does not work for programmatic cell edits.</p>
  
  <p>I tried <code>CellValidating</code> Event but does not fire for the programmatic edits.</p>
  
  <p>Will appreciate your help.
  Thank you.</p>