//点击单元格时,将单元格属性显示 private void grd_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (e.ColumnIndex < 0) { return; } txtPmax.Text = grd.Rows[e.RowIndex].Cells["Pmax"].Value.ToString(); txtVmp.Text = grd.Rows[e.RowIndex].Cells["Vmp"].Value.ToString(); txtImp.Text = grd.Rows[e.RowIndex].Cells["Imp"].Value.ToString(); txtVoc.Text = grd.Rows[e.RowIndex].Cells["Voc"].Value.ToString(); txtIsc.Text = grd.Rows[e.RowIndex].Cells["Isc"].Value.ToString(); txtVolmax.Text = grd.Rows[e.RowIndex].Cells["Volmax"].Value.ToString(); txtFusemax.Text = grd.Rows[e.RowIndex].Cells["Fusemax"].Value.ToString(); txtModuleApp.Text = grd.Rows[e.RowIndex].Cells["ModuleApp"].Value.ToString(); txtUpperPower.Text = grd.Rows[e.RowIndex].Cells["UpperPower"].Value.ToString(); txtLowerPower.Text = grd.Rows[e.RowIndex].Cells["LowerPower"].Value.ToString(); //增加产品族 add by lei.xue on 2017-7-30 txtProductType.Text = grd.Rows[e.RowIndex].Cells["ProductType"].Value.ToString(); //2019.05.20 txtUpperE.Text = grd.Rows[e.RowIndex].Cells["UpperImp"].Value.ToString(); txtLowerE.Text = grd.Rows[e.RowIndex].Cells["LowerImp"].Value.ToString(); //车间 DataTable dt = crud.QueryareaN1(grd.Rows[e.RowIndex].Cells["CJ"].Value.ToString()); cjxz.SelectedItem = dt.Rows[0]["PRIDISPLAYNAME"].ToString(); if (grd.Rows[e.RowIndex].Cells["dlbz"].Value.ToString() == "1") { DLPD.Checked = true; } else { DLPD.Checked = false; } }