I had to modify a sequence in a form using the DataGridView control and I found out I needed to know what cell was selected.
The first thing I did was to make sure the MultiSelect property is false.
Then, by trial and error and some help from SO, I found the following sequence:

var selectedCells = _grid.SelectedCells.Cast<DataGridViewCell>();
var selectedCellIsInFirstColumn = selectedCells.Any(i => i.ColumnIndex == 0);
Advertisements