protected void gdCostInfo_RowDoubleClick(object sender, GridRowClickEventArgs e) { int ID = GetSelectedDataKeyID(gdCostInfo); PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("~/Contract/ContractDoorEdit.aspx?id={0}", ID) , "编辑门明细信息")); }
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) { string keyid = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][0].ToString(); string ftype = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][1].ToString(); var parms = new Dictionary <string, object>(); parms.Clear(); parms.Add("@keyid", keyid); parms.Add("@bill", ftype); var data = SqlService.ExecuteProcedureCommand("proc_StockInDetails", parms); if (data != null && data.Tables.Count > 0 && data.Tables[0].Rows.Count > 0) { Grid2.DataSource = data; Grid2.DataBind(); } else { Grid2.DataSource = null; Grid2.DataBind(); } }
protected void gvList_RowClick(object sender, GridRowClickEventArgs e) { try { if (e.RowIndex >= 0) { int gridRowID = e.RowIndex; object[] keys = gvList.DataKeys[e.RowIndex]; //根据选中的行得到当前选中的实例 if (Convert.ToInt32(keys[0]) != 0) { dictComment = new Dictfastcomment(); dictComment.Dictfastcommentid = TypeParse.StrToDouble(keys[0], 0); this.tbxFastcode.Text = TypeParse.ObjToStr(keys[1], ""); this.tbxHotkey.Text = TypeParse.ObjToStr(keys[2], ""); this.tbxKeymask.Text = TypeParse.ObjToStr(keys[3], ""); this.tbxModulename.Text = TypeParse.ObjToStr(keys[4], ""); this.Txa.Text = TypeParse.ObjToStr(keys[5], ""); this.Drop_DictLabDepTid.SelectedValue = TypeParse.StrToDouble(keys[6], 0).ToString(); SimpleForm3.Title = "当前状态-编辑"; } } } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } }
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) { try { if (Grid1.SelectedRowIndexArray.Length == 0) { Alert.Show("请至少选择一项!", MessageBoxIcon.Information); } else if (Grid1.SelectedRowIndexArray.Length > 1) { Alert.Show("只能选择一项!", MessageBoxIcon.Information); } else { string sid = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][0].ToString(); PageContext.RegisterStartupScript( // string.Format("openDetailsUI('{0}','{1}','{2}','{3}');", // sid, // CurrentUser.AccountComId, // dpFDate.SelectedDate.Value.ToString("yyyy-MM-dd"), // ddlFDistributionPoint.SelectedValue)); } } catch (Exception) { Alert.Show("操作失败!", MessageBoxIcon.Warning); } }
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) { int ID = GetSelectedDataKeyID(Grid1); PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("~/SysSet/CarEdit.aspx?id={0}&action=edit", ID) , "编辑车辆信息")); }
protected void GridGoodsConfig_RowDoubleClick(object sender, GridRowClickEventArgs e) { //JObject defaultObj = Doc.GetJObject(GridGoodsConfig, e.RowID); string strGDSEQ = GridGoodsConfig.Rows[e.RowIndex].DataKeys[0].ToString(); //string strGDSEQ = (defaultObj["GDSEQ"] ?? "").ToString(); string dptSql = string.Format(@"SELECT ROWNO,CODE,NAME FROM ( SELECT GDSEQ, ROWNUM ROWNO,B.CODE,B.NAME FROM DOC_GOODSCFG A, SYS_DEPT B WHERE A.DEPTID = B.CODE ORDER BY CODE ) WHERE GDSEQ = '{0}'", strGDSEQ); DataTable dt = DbHelperOra.Query(dptSql).Tables[0]; DataTable dtDEPT = DbHelperOra.Query(strDEPT).Tables[0]; List <int> sel = new List <int>(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { for (int i = 0; i < dtDEPT.Rows.Count; i++) { if (dtDEPT.Rows[i]["CODE"].ToString() == dr["CODE"].ToString()) { sel.Add(i); } } } } GridDepartment.SelectedRowIndexArray = sel.ToArray(); }
protected void gvList_RowClick(object sender, GridRowClickEventArgs e) { try { if (e.RowIndex >= 0) { int gridRowID = e.RowIndex; object[] keys = gvList.DataKeys[e.RowIndex]; //根据选中的行得到当前选中的实例 if (Convert.ToInt32(keys[0]) != 0) { int id = Convert.ToInt32(gvList.DataKeys[e.RowIndex][0].ToString()); //获取Grid1中第e.RowIndex+1行的第一个DateKeyName值 //编辑绑定数据 List <Dictcustomertestdiscount> dictcustomerdiscountedList = loginservice.GetDictcustomerdiscount(); //体检单位总体价格 Dictcustomertestdiscount dictcustomer = dictcustomerdiscountedList.Where <Dictcustomertestdiscount>(c => c.Dictcustomerdiscountid == id).First <Dictcustomertestdiscount>(); //Dictcustomertestdiscount dictCounted = new DictcustomertestdiscountService().GetDictcustomerdiscountById(id); //dictCountedId = Convert.ToDouble(dictcustomer.Dictcustomerdiscountid); this.tbxFinalprice.Text = dictcustomer.Finalprice.ToString(); this.Drop_DictTestItemId.SelectedValue = dictcustomer.Dicttestitemid.ToString(); this.DatePicker1.SelectedDate = dictcustomer.Begindate; this.DatePicker2.SelectedDate = dictcustomer.Enddate; SimpleFormEdit.Title = "当前状态-编辑"; } } } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } }
protected void GridSupplier_RowDoubleClick(object sender, GridRowClickEventArgs e) { string strCode = GridSupplier.DataKeys[e.RowIndex][0].ToString(); hfdsavecount.Text = strCode; cxsj(strCode); }
protected void GridQuestion_RowDoubleClick(object sender, GridRowClickEventArgs e) { if (GridQuestion.Rows.Count == 0) { return; } string strSeq = ((FineUIPro.Grid)sender).Rows[e.RowIndex].Values[1].ToString(); DataTable dt = DbHelperOra.Query("SELECT * FROM PRO_QUESTION WHERE SEQ='" + strSeq + "'").Tables[0]; PubFunc.FormDataSet(FormQuest, dt.Rows[0]); hfdISNEW.Text = "N"; if (!string.IsNullOrWhiteSpace(dt.Rows[0]["IMAGE"].ToString())) { lnkImage.NavigateUrl = dt.Rows[0]["IMAGE"].ToString(); lnkImage.Text = dt.Rows[0]["IMAGE"].ToString(); lnkImage.Hidden = false; } else { lnkImage.Hidden = true; } if (hfdFlag.Text == "answer") { PubFunc.FormLock(FormQuest, true); fudIMAGE.Enabled = false; ddlSTATUS.Enabled = true; ddlDOUSER.SelectedValue = UserAction.UserID; ddlDOUSER.Enabled = true; dpkDOTIME.SelectedDate = DateTime.Now; dpkDOTIME.Enabled = true; txaHOWDO.Enabled = true; } }
protected void Grid2_RowDoubleClick(object sender, GridRowClickEventArgs e) { int rowIndex = e.RowIndex; string tradeSN = Grid2.DataKeys[rowIndex][0].ToString(); LoadDataBySN(tradeSN); }
protected void gd_UnitAPeople_RowClick(object sender, GridRowClickEventArgs e) { string person = gd_UnitAPeople.Rows[e.RowIndex].Values[0].ToString(); BLHelper.BLLUser user = new BLLUser(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Convert.ToInt32(Session["SecrecyLevel"]) != 5 && person != username) { string str = "您没有对此行操作的权限!此行为" + person + "录入,请与管理员联系!"; Alert.ShowInTop(str); CBoxSelect.SetCheckedState(e.RowIndex, false); } if (pm.GridCount(gd_UnitAPeople, CBoxSelect).Count == 0) { btn_Delete.Enabled = false; return; } else { btn_Delete.Enabled = true; return; } }
/// <summary> /// Grid行双击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) { if (Grid1.SelectedRowIndexArray.Length == 0) { Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); return; } string SupervisionNoticeId = Grid1.SelectedRowID; var SupervisionNotice = BLL.SupervisionNoticeService.GetSupervisionNoticeById(SupervisionNoticeId); if (SupervisionNotice != null) { if (!string.IsNullOrEmpty(SupervisionNotice.CheckPerson)) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SupervisionNoticeView.aspx?SupervisionNoticeId={0}", SupervisionNoticeId, "查看 - "))); } else { if (this.btnAuditing.Hidden == true) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SupervisionNoticeEdit.aspx?SupervisionNoticeId={0}", SupervisionNoticeId, "编辑 - "))); } else { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SupervisionNoticeEdit.aspx?states=check&SupervisionNoticeId={0}", SupervisionNoticeId, "审核 - "))); } } } }
/// <summary> /// 绑定详细信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridList_RowClick(object sender, GridRowClickEventArgs e) { try { if (e.RowIndex >= 0) { int gridRowID = e.RowIndex; object[] keys = GridList.DataKeys[e.RowIndex]; //根据选中的行得到当前选中的实例 if (Convert.ToInt32(keys[0]) != 0) { int id = Convert.ToInt32(GridList.DataKeys[e.RowIndex][0].ToString());//获取Grid1中第e.RowIndex+1行的第一个DateKeyName值 //编辑绑定数据 dictlabandtestprice.Dictlabandtestpriceid = id; Dictlabandtestprice dictCountedprice = new DictlabandtestpriceService().GetDictlabandtestpriceById(id); dictCountedId = Convert.ToDouble(dictlabandtestprice.Dictlabandtestpriceid); this.tbxFinalprice.Text = dictCountedprice.Price.ToString(); this.DatePicker1.SelectedDate = dictCountedprice.Begindate; this.DatePicker2.SelectedDate = dictCountedprice.Enddate; this.Form1.Title = "当前状态-编辑"; } } } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } }
protected void GridLis_RowDoubleClick(object sender, GridRowClickEventArgs e) { string billno = GridGoods.Rows[e.RowIndex].Values[1].ToString(); string url = "~/ERPPayment/Doc_CK_ComWindow.aspx?bm=" + billno + "&cx=&su="; PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hfdValue.ClientID) + Window1.GetShowReference(url, "出库信息:单号【" + billno + "】")); }
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) { string ccode = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][1].ToString(); string cname = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][2].ToString(); PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(ccode, cname) + ActiveWindow.GetHideReference()); }
protected void GridList_RowDoubleClick(object sender, GridRowClickEventArgs e) { string billno = GridList.DataKeys[e.RowIndex][0].ToString(); string url = url = "~/ERPApply/CKWindow.aspx?bm=" + billno + ""; PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hfdValue.ClientID) + Window1.GetShowReference(url, "出库信息:单号【" + billno + "】")); }
private void SGC_ToolPath_RowClick(object sender, GridRowClickEventArgs e) { //取得點選的RowIndex CurrentRowIndex = e.GridRow.Index; CurrentSelOperName = panel.GetCell(CurrentRowIndex, 0).Value.ToString(); SelectedElementCollection selRow = panel.GetSelectedElements(); ListSelOper = new List <string>(); foreach (GridRow item in selRow) { ListSelOper.Add(item.Cells[1].Value.ToString()); } NXOpen.CAM.Preferences preferences1 = theSession.CAMSession.CreateCamPreferences(); if (ListSelOper.Count == 1) { preferences1.ReplayRefreshBeforeEachPath = true; } else if (ListSelOper.Count > 1) { preferences1.ReplayRefreshBeforeEachPath = false; } preferences1.Commit(); preferences1.Destroy(); //UG顯示刀具路徑 ExportShopDocDlg cExportShopDocDlg = new ExportShopDocDlg(); cExportShopDocDlg.DisplayOpPath(ListSelOper); }
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) { //object[] o= Grid1.Rows[e.RowIndex].Values; string[] s = Grid1.SelectedCell; if (s[1] == "RealUsingQuantity") { return; } //GridRow row=Grid1.Rows[e.RowIndex]; //DataRowView rowview = row.DataItem as DataRowView for (int i = 0; i < Grid1.Columns.Count; i++) { if (s[1] == Grid1.Columns[i].ColumnID && !htClickColsName.ContainsKey(s[1])) { //ClickColVal = Grid1.Rows[e.RowIndex].Values[i].ToString(); //ClickRowIndex = e.RowIndex; htClickColsName.Add(s[1], Grid1.Rows[e.RowIndex].Values[i].ToString()); //ClickColName = s[1]; break; } } BindGrid(); //txtClickColsName.Text = string.Join(",", (string[])alClickColsName.ToArray(typeof(string))); updatecol(); }
protected void Grid2_RowClick(object sender, GridRowClickEventArgs e) { foreach (int rowindex in Grid1.SelectedRowIndexArray) { Grid1.UpdateCellValue(rowindex, "SupplierId", ddlProvider.Value); } }
/// <summary> /// 选中一行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void superGridControl1_RowClick(object sender, GridRowClickEventArgs e) { var rows = superGridControl1.PrimaryGrid.GetSelectedRows(); if (rows.Count != 1) { MessageBox.Show("请选择一行"); superGridControl1.PrimaryGrid.ClearSelectedColumns(); return; } GridRow row = (GridRow)rows[0]; txtName.Text = row.Cells["Name"].Value.ToString(); txtCompanyName.Text = row.Cells["CompanyName"].Value.ToString(); txtDuty.Text = row.Cells["Duty"].Value.ToString(); txtEmail.Text = row.Cells["Email"].Value.ToString(); txtPosition.Text = row.Cells["Position"].Value.ToString(); txtQQ.Text = row.Cells["QQ"].Value.ToString(); txtTel.Text = row.Cells["Tel"].Value.ToString(); txtWechat.Text = row.Cells["Wechat"].Value.ToString(); cmbSendType.SelectedIndex = -1; cmbType.SelectedIndex = -1; string select = string.IsNullOrEmpty(row.Cells["Type"].Value.ToString()) ? "0" : row.Cells["Type"].Value.ToString(); string select1 = string.IsNullOrEmpty(row.Cells["SendType"].Value.ToString()) ? "0" : row.Cells["SendType"].Value.ToString(); DataHelper.SetComboBoxSelectItemByValue(cmbType, select); DataHelper.SetComboBoxSelectItemByValue(cmbSendType, select1); cbIspublic.CheckValue = Convert.ToInt32(string.IsNullOrEmpty(row.Cells["IsPublic"].Value.ToString()) ? "0" : row.Cells["IsPublic"].Value.ToString()); ID = row.Cells["ID"].Value.ToString(); dtiCreated.Value = string.IsNullOrEmpty(ID) ? DateTime.Now : Convert.ToDateTime(row.Cells["CREATED"].Value.ToString()); CREATED = Convert.ToDateTime(row.Cells["CREATED"].Value.ToString()); }
protected void Grid2_RowClick(object sender, GridRowClickEventArgs e) { for (int i = 0; i < Grid1.Rows.Count; i++) { Grid1.UpdateCellValue(i, "Provider", ddlProvider.Text); } }
//============操作方法=========== #region 二级菜单 /// <summary> /// 行双击事件 ///创建 毛枫 2015-4-20 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) { object[] keys = Grid1.DataKeys[e.RowIndex]; fathercode = keys[1].ToString(); CrumbString += fathercode + ","; Replace(); }
protected void GridList_RowDoubleClick(object sender, GridRowClickEventArgs e) { billOpen(GridList.Rows[e.RowIndex].DataKeys[0].ToString()); if (GridList.Rows[e.RowIndex].Values[4].ToString() == "已收货") { hfdISSH.Text = "Y"; btnAudit.Enabled = false; } else { hfdISSH.Text = "N"; btnAudit.Enabled = true; } string flag = ""; switch (GridList.Rows[e.RowIndex].Values[4].ToString()) { case "已收货": flag = "SH"; break; case "已出库": flag = "CK"; break; case "未出库": flag = "NK"; break; } docFLAG.SelectedValue = flag; }
//将选中的结果录入值给编辑框 protected void gvOrderTest_RowClick(object sender, GridRowClickEventArgs e) { if (gvOrderTest.SelectedRowIndexArray.Count <int>() != 0) { object[] objValue = gvOrderTest.DataKeys[gvOrderTest.SelectedRowIndexArray[0]]; //是否检验项目,如果是结果值不能更改[ParamStatus.LabdeptType.FunctionDepartment为检验项目] List <Dictlabdept> labdept = loginservice.GetLoginDictlabdeptList(); if (objValue[6].ToString() != "22" && labdept.Count(c => c.Labdepttype == ((int)ParamStatus.LabdeptType.InspectionDepartment).ToString() && c.Dictlabdeptid == TypeParse.StrToDouble(objValue[6], 0)) > 0) { txtTestResult.Enabled = false; btnTestResult.Hidden = true; btnResultSelect.Hidden = true; chkIsexception.Enabled = false; } else { txtTestResult.Enabled = true; btnTestResult.Hidden = false; btnResultSelect.Hidden = false; chkIsexception.Enabled = true; } txtTestResult.Text = TypeParse.ObjToStr(objValue[3], ""); chkIsexception.Checked = TypeParse.ObjToStr(objValue[7], "正常") == "正常" ? false : true; //结果录入模板初始化 btnResultSelect.OnClientClick = WinResultEdit.GetSaveStateReference(txtTestResult.ClientID) + WinResultEdit.GetShowReference(string.Format("AnaResult_Windows.aspx?testId={0}", objValue[4]), "检查结果模板选择"); } else { txtTestResult.Text = ""; } }
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) { //if (Grid1.SelectedRowIndexArray.Length == 0) //{ // Alert.Show("请至少选择一项!", MessageBoxIcon.Information); //} //string keyid = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][0].ToString(); //var parms = new Dictionary<string, object>(); //parms.Clear(); //parms.Add("@keyid",keyid); //parms.Add("@companyid", CurrentUser.AccountComId); //var data = SqlService.ExecuteProcedureCommand("rpt_StockOutDetails", parms) .Tables[0]; //if (data != null && data.Rows.Count > 0) //{ // Grid2.DataSource = data; // Grid2.DataBind(); //} //else //{ // Grid2.DataSource = null; // Grid2.DataBind(); //} }
//显示详细信息 protected void gdDiagnosis_RowClick(object sender, GridRowClickEventArgs e) { Dictdiagnosis dictdiagnosis = new Dictdiagnosis(); object[] keys = gdDiagnosis.DataKeys[e.RowIndex]; List <Dictdiagnosis> diagnosisAll = GetDiagnosisAll(); dictdiagnosis = (from Dictdiagnosis in diagnosisAll where Dictdiagnosis.Dictdiagnosisid == Convert.ToDouble(keys[0]) select Dictdiagnosis).ToList <Dictdiagnosis>()[0]; txtdiagnosisname.Text = dictdiagnosis.Diagnosisname; ddldiagnosistype.SelectedValue = dictdiagnosis.Diagnosistype; if (dictdiagnosis.Isdisease == "1") { chbisdisease.Checked = true; } else { chbisdisease.Checked = false; } tadiseasedescription.Text = dictdiagnosis.Diseasedescription; tadiseasecause.Text = dictdiagnosis.Diseasecause; tasuggestion.Text = dictdiagnosis.Suggestion; taengdiseasedescription.Text = dictdiagnosis.Engdiseasedescription; taengdiseasecause.Text = dictdiagnosis.Engdiseasecause; taengsuggestion.Text = dictdiagnosis.Engsuggestion; txtdiagnosiscode.Text = dictdiagnosis.Diagnosiscode; }
protected void GridLis_RowDoubleClick(object sender, GridRowClickEventArgs e) { string billno = GridGoods.DataKeys[e.RowIndex][0].ToString(); string type = GridGoods.DataKeys[e.RowIndex][1].ToString(); string url = ""; if (type == "CKD" || type == "DSC" || type == "DST" || type == "LCD" || type == "LTD") { url = "~/ERPPayment/Doc_CK_ComWindow.aspx?bm=" + billno + "&cx=&su=" + ddlSUPID.SelectedValue; PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hfdValue.ClientID) + Window1.GetShowReference(url, "出库信息:单号【" + billno + "】")); } if (type == "XSD" || type == "XST") { url = "~/ERPPayment/Doc_XS_ComWindow.aspx?bm=" + billno + "&cx=&su=" + ddlSUPID.SelectedValue; PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hfdValue.ClientID) + Window1.GetShowReference(url, "销售信息:单号【" + billno + "】")); } if (type == "RKD") { url = "~/ERPPayment/Doc_RK_ComWindow.aspx?bm=" + billno + "&cx=&su=" + ddlSUPID.SelectedValue; PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hfdValue.ClientID) + Window1.GetShowReference(url, "入库信息:单号【" + billno + "】")); } if (type == "KSD") { url = "~/ERPPayment/Doc_DB_ComWindow.aspx?bm=" + billno + "&cx=&su=" + ddlSUPID.SelectedValue; PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hfdValue.ClientID) + Window1.GetShowReference(url, "入库信息:单号【" + billno + "】")); } }
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) { int ID = GetSelectedDataKeyID(Grid1); PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("~/Equipment/EquipmentEdit.aspx?id={0}", ID) , "编辑商品商品")); }
/// <summary> /// 范围行点击 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void superRange_RowClick(object sender, GridRowClickEventArgs e) { var rows = superRange.PrimaryGrid.GetSelectedRows(); if (rows.Count != 1) { MessageBox.Show("请选择一行"); superRange.PrimaryGrid.ClearSelectedColumns(); return; } btnClearRangeFile_Click(null, null); GridRow row = (GridRow)rows[0]; DomainDLL.Change change = new DomainDLL.Change(); DataTable files = new DataTable(); bll.GetChangeInfo(row.Cells["ID"].Value.ToString(), out change, out files); CHANGERANGEID = row.Cells["ID"].Value.ToString();//版本id if (change != null) { txtRangeCost.Text = change.Cost; txtRangeName.Text = change.Name; txtRangePayment.Text = change.Payment; txtRangeReason.Text = change.Reason; txtRangeAfter.Text = change.AfterInfo; txtRangeBefore.Text = change.BeforeInfo; _changerangeid = change.ID;//实际id } superGridControl3.PrimaryGrid.DataSource = files; }
protected void gvList_RowClick(object sender, GridRowClickEventArgs e) { try { if (e.RowIndex >= 0) { int gridRowID = e.RowIndex; object[] keys = gvList.DataKeys[e.RowIndex]; //根据选中的行得到当前选中的实例 if (Convert.ToInt32(keys[0]) != 0) { dictlabdep = new Dictlabdept(); dictlabdep.Dictlabdeptid = TypeParse.StrToDouble(keys[0], 0); if (dictlabdep.Dictlabdeptid != 0) { this.tbxLabdeptname.Text = TypeParse.ObjToStr(keys[1], ""); this.Drop_LabdeptTyped.SelectedValue = TypeParse.ObjToStr(keys[2], ""); SimpleFormEdit.Title = "当前状态-编辑"; } } } } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } }