heisetoufa 发表于 2013-2-5 01:49:55

c# winform RowEnter 获得选中的DataGridView中的行的字段值

private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e){int rowIndex = e.RowIndex;//获取当前行string s = dataGridView1.Rows.Cells["xh"].Value.ToString(); //获取当前行xh字段的值MessageBox.Show(s);}

这样就获得了选中的DataGridView中的行的字段值

黑色头发:http://heisetoufa.iteye.com/
页: [1]
查看完整版本: c# winform RowEnter 获得选中的DataGridView中的行的字段值