This may help you
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
{ MessageBox.Show(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
}
}
or you could use the
gridview selection change event in that you could use like the following code.
int Selectedrow=gridvview.selectedindex;
string selectedcellvalue =(gridview.rows[Selectedrow].cells[0].text).ToString();
like this you can use for the other cell values like 0,1,2,3...