int i = dgvUserInfo.CurrentCell.RowIndex;//获取选中行索引 int id = (int)dgvUserInfo.Rows[i].Cells["Id"].Value;//获取选中行数据的标识列值