private void btnUpdatePro_Click(object sender, EventArgs e) { if (dgvProductInfo.SelectedRows.Count > 0) { var id = Convert.ToInt32(dgvProductInfo.SelectedRows[0].Cells[0].Value); mea.Obj = proiBll.GetProductInfoById(id); LoadFrmChangeProductInfo(2); } else { MessageBox.Show("未选中行"); } }