void OnCellEditBegin(object sender, DataGridViewCellCancelEventArgs e) { m_NeedsSaving = true; CellEditInfo action = new CellEditInfo(); action.ColIndex = e.ColumnIndex; action.RowIndex = e.RowIndex; if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) { action.Value = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); } else action.Value = ""; m_ColumnActions.Push(action); }