DataGridView de herhangi bir hücreyi seçtiğimizde bu hücrenin satır kolon ve hücre içeriğini elde etmek isteyebiliriz. Bu durumda aşağıda ki kod işimize yarayabilir.
if (dataGridView1.SelectedCells.Count> 0) { int columnIndex = dataGridView1.CurrentCell.ColumnIndex; int rowIndex = dataGridView1.CurrentCell.RowIndex; string a =dataGridView1.Rows[rowIndex].Cells[columnIndex].Value.ToString(); }