private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
//--This start the editing of the cells
//Here we save a current value of cell to some variable, that later we can compare with a new value
//For example using of dgv.Tag property
// MessageBox.Show("value = " + dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
{
this.dataGridView1.Tag = this.dataGridView1.CurrentCell.Value;
if(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) {
beginEditText = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
//Or cast sender to DataGridView variable-> than this handler can be used in another datagridview
}
}
}