private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { string str = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); MessageBox.Show(str); } }