private void barEdit1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { GridColumn gc = this.ctrlItemPlanTable_HuaiBei1.GridView.FocusedColumn; if (gc == null) { return; } if (gc.FieldName.Substring(0, 1) != "S") { return; } FrmPlanTable_AddBands frm = new FrmPlanTable_AddBands(); frm.ClassName = gc.Caption; frm.ClassType = gc.FieldName; frm.Type = type; frm.Flag = flag; frm.Type2 = "PlanTable"; frm.IsUpdate = true; frm.Text = "修改分类"; if (frm.ShowDialog() == DialogResult.OK) { // gc.Caption = frm.ClassName; InitValues(); } }
private void barAdd1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { FrmPlanTable_AddBands frm = new FrmPlanTable_AddBands(); frm.Type = type; frm.Flag = flag; frm.Type2 = "PlanTable"; frm.AddFlag = "PTFlag"; if (frm.ShowDialog() == DialogResult.OK) { InitValues(); } // if (frm.ShowDialog() == DialogResult.OK) // { // foreach(GridColumn gc in this.ctrlItemPlanTable_HuaiBei1.GridView.Columns) // { // if (gc.FieldName == frm.ClassType) // { // gc.Caption = frm.ClassName; // gc.Visible = true; // gc.OptionsColumn.ShowInCustomizationForm = true; // } // } // if (gc.Columns[0].FieldName.Substring(0, 1) == "S") // { // gc.Visible = false; // foreach (PowerSubstationLine pss in li) // { // if (gc.Columns[0].FieldName == pss.ClassType) // { // gc.Visible = true; // gc.Caption = pss.Title; // gc.Columns[0].Caption = pss.Title; // gc.Columns[0].Visible = true; // gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; // } // } // } //} } catch (Exception ex) { MsgBox.Show(ex.Message); } }
private void barEdit1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { GridColumn gc = this.ctrlItemPlanTable_HuaiBei1.GridView.FocusedColumn; if (gc == null) return; if (gc.FieldName.Substring(0, 1) != "S") return; FrmPlanTable_AddBands frm = new FrmPlanTable_AddBands(); frm.ClassName = gc.Caption; frm.ClassType = gc.FieldName; frm.Type = type; frm.Flag = flag; frm.Type2 = "PlanTable"; frm.IsUpdate = true; frm.Text = "�ķ���"; if (frm.ShowDialog() == DialogResult.OK) { // gc.Caption = frm.ClassName; InitValues(); } }