I would like to add the following functionality in my DataGridView, make it so that you can choose two or more cells only and delete their contents (maybe with a right click and then choose delete). Currently my implementation for the cell value changed event is:
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
double currentCellValue;
string PinInGrid = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
if (!double.TryParse(PinInGrid, out currentCellValue))
{
MessageBox.Show("Incorrect input!");
DataTable dt = this.dataGridView1.DataSource as DataTable;
dt.RejectChanges();
return;
}
}
Is this possible?