/// <summary> /// 编辑数据表的数据信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEditData_Click(object sender, EventArgs e) { DataTable dataTable = this.grdDataList.DataSource as DataTable; if (dataTable != null && dataTable.Rows.Count > 0) { DataRow[] selectedRows = dataTable.Select(string.Format("{0} = True", COMMON_FIELDS.FIELD_COMMON_CHECKED)); if (selectedRows.Length > 0) { this.SelectedData = selectedRows; } else { MessageService.ShowMessage("请选择数据!"); } if (SelectedData != null && SelectedData.Length > 0) { DataRow selectedRow = SelectedData[0]; TreeNode tn = new TreeNode(); tn.Tag = selectedRow[BASE_ATTRIBUTE_CATEGORY_FIELDS.FIELDS_CATEGORY_KEY].ToString().Trim(); tn.Text = selectedRow[BASE_ATTRIBUTE_CATEGORY_FIELDS.FIELDS_CATEGORY_NAME].ToString().Trim(); BasicSettingsDatDetail basicSettingsDatDetail = new BasicSettingsDatDetail(tn); basicSettingsDatDetail.Dock = DockStyle.Fill; panel1.Controls.Clear(); panel1.Controls.Add(basicSettingsDatDetail); } } else { MessageService.ShowMessage("请查询数据!"); } }
public BasicSettingsDatViewContent(TreeNode tr) : base() { //get parameter treenode tn = tr; //define panel Panel panel = new Panel(); //set panel dock style panel.Dock = DockStyle.Fill; //set panel BorderStyle panel.BorderStyle = BorderStyle.FixedSingle; //define usercontrol BasicSettingsDetail BasicSettingsDatDetail basicSettingsdatDetail = new BasicSettingsDatDetail(tn); basicSettingsdatDetail.Dock = DockStyle.Fill; //add control to panle panel.Controls.Add(basicSettingsdatDetail); //set panel to view content this.control = panel; //set viewcontent's title name this.TitleName = tr.Text.ToString() + StringParser.Parse("${res:FanHai.Hemera.Addins.BasicData.BasicSettingsDatViewContent.ViewContentPartTitle}"); }