怎样获取DataGreidView单元格的值?
请问怎样获取到DataGridView中用户选定的行的第一列里的数据呢?
private void button1_Click(object sender, EventArgs e) { foreach (DataGridViewRow dr in this.dataGridView1.Rows) { if (dr.Selected == true) { string str = dr.Cells[0].Value.ToString(); } } }