title: UpdateCellValue() in a Datagridview
body: <p>I'm using the following code to update a DataGridView's cell value. This is called inside the 'CellDoubleClick' event handler for the DataGridView. </p>
  
  <p>The problem is the cell only updates after I click onto another cell. Is there a better way of doing this?</p>
  
  <pre><code>string value = "";
  if (_dataGrid1.CurrentRow.Cells[e.ColumnIndex].Value != null)
      value = _dataGrid1.CurrentRow.Cells[e.ColumnIndex].Value.ToString();
  
  FormEdit form = new FormEdit(value); // takes a string value
  if (form.ShowDialog() == DialogResult.OK)
  {
      _dataGrid1.CurrentRow.Cells[e.ColumnIndex].Value = form.SourceText;
      _dataGrid1.UpdateCellValue(e.ColumnIndex, e.RowIndex);
  }
  </code></pre>
  
  <p><em>Some variable names were changed to protect their identity</em></p>