private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int rowIndex = e.RowIndex; // Get the order of the current row
DataGridViewRow row = dataGridView1.Rows[rowIndex];//Store the value of the current row in a variable
MessageBox.Show(row.Cells[rowIndex].Value.ToString());//show message for current row
}