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]