protected void ASPxTreeList1_CustomCallback(object sender, TreeListCustomCallbackEventArgs e) { ASPxTreeList1.CollapseAll(); TreeListNode node = ASPxTreeList1.FindNodeByKeyValue(e.Argument); while (node.ParentNode != null) { node.Expanded = true; node = node.ParentNode; } }
//void ASPxTreeList1_NodeInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) //{ // string result = this.parseMenuData(false, // operate.AddNew, // theCompanyCode, // O2S(e.NewValues["MENU_CODE"]), // O2S(e.NewValues["MENU_NAME"]), // O2S(e.NewValues["MENU_NAME_EN"]), // O2S(e.NewValues["MENU_CODE_FATHER"]), // O2S(e.NewValues["MENU_LEVEL"]), // O2S(e.NewValues["MENU_INDEX"]), // O2S(e.NewValues["LEAF_FLAG"]), // O2S(e.NewValues["PROGRAM_CODE"]) // ); // if (result.Length > 0) // { // e.Cancel = false; // } // else // { // ASPxTreeList1.CancelEdit(); // e.Cancel = true; // bindData(); // } //} private void bindData() { userManager theUserManager = (userManager)Session["theUserManager"]; this.TranslateASPxControl(ASPxTreeList1); theCompanyCode = theUserManager.getCompanyCode(); theContentPrintSql = "Select * from (SELECT A.*,B.TEAM_CODE FROM AAA12020 A LEFT JOIN REL_PROCESS_TEAM B ON A.工艺序号=B.PROCESS_NUM WHERE 装入序号 IS NOT NULL AND 批次=2 ORDER BY 装入序号,工艺序号) where rownum<6000"; DataTable dt = conn.GetTable(theContentPrintSql); ASPxTreeList1.KeyFieldName = "工艺序号"; ASPxTreeList1.ParentFieldName = "装入序号"; ASPxTreeList1.SettingsEditing.Mode = DevExpress.Web.ASPxTreeList.TreeListEditMode.PopupEditForm; ASPxTreeList1.SettingsPopupEditForm.HorizontalAlign = DevExpress.Web.ASPxClasses.PopupHorizontalAlign.Center; ASPxTreeList1.SettingsPopupEditForm.VerticalAlign = DevExpress.Web.ASPxClasses.PopupVerticalAlign.WindowCenter; ASPxTreeList1.SettingsPopupEditForm.AllowResize = true; ASPxTreeList1.SettingsPopupEditForm.Modal = true; ASPxTreeList1.SettingsPopupEditForm.Width = 500; ASPxTreeList1.SettingsPopupEditForm.Caption = "BOM编辑"; ASPxTreeList1.DataSource = dt; ASPxTreeList1.DataBind(); ASPxTreeList1.CollapseAll(); ASPxTreeList1.ExpandToLevel(0); //ASPxTreeList1.SettingsEditing.AllowNodeDragDrop = true; //ASPxTreeList1.ProcessDragNode += new DevExpress.Web.ASPxTreeList.TreeListNodeDragEventHandler(ASPxTreeList1_ProcessDragNode); ASPxTreeList1.CellEditorInitialize += new DevExpress.Web.ASPxTreeList.TreeListColumnEditorEventHandler(ASPxTreeList1_CellEditorInitialize); //ASPxTreeList1.NodeValidating += new DevExpress.Web.ASPxTreeList.TreeListNodeValidationEventHandler(ASPxTreeList1_NodeValidating); //ASPxTreeList1.NodeInserting += new DevExpress.Web.Data.ASPxDataInsertingEventHandler(ASPxTreeList1_NodeInserting); ASPxTreeList1.NodeUpdating += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(ASPxTreeList1_NodeUpdating); //ASPxTreeList1.NodeDeleting += new DevExpress.Web.Data.ASPxDataDeletingEventHandler(ASPxTreeList1_NodeDeleting); //ASPxTreeList1.HtmlRowPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventHandler(ASPxTreeList1_HtmlRowPrepared); //ASPxTreeList1.HtmlDataCellPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlDataCellEventHandler(ASPxTreeList1_HtmlDataCellPrepared); //ASPxTreeList1.ParseValue += new DevExpress.Web.Data.ASPxParseValueEventHandler(ASPxTreeList1_ParseValue); }
private void bindData() { userManager theUserManager = (userManager)Session["theUserManager"]; this.TranslateASPxControl(ASPxTreeList1); theCompanyCode = theUserManager.getCompanyCode(); theContentPrintSql = "select * from code_work_unit"; DataTable dt = conn.GetTable(theContentPrintSql); ASPxTreeList1.KeyFieldName = "WORKUNIT_CODE"; ASPxTreeList1.ParentFieldName = "WORKUNIT_PARENTCODE"; ASPxTreeList1.SettingsEditing.Mode = DevExpress.Web.ASPxTreeList.TreeListEditMode.PopupEditForm; ASPxTreeList1.SettingsPopupEditForm.HorizontalAlign = DevExpress.Web.ASPxClasses.PopupHorizontalAlign.Center; ASPxTreeList1.SettingsPopupEditForm.VerticalAlign = DevExpress.Web.ASPxClasses.PopupVerticalAlign.WindowCenter; ASPxTreeList1.SettingsPopupEditForm.AllowResize = true; ASPxTreeList1.SettingsPopupEditForm.Modal = true; ASPxTreeList1.SettingsPopupEditForm.Width = 500; ASPxTreeList1.SettingsPopupEditForm.Caption = "工作单元编辑"; ASPxTreeList1.DataSource = dt; ASPxTreeList1.DataBind(); ASPxTreeList1.CollapseAll(); ASPxTreeList1.ExpandToLevel(2); //ASPxTreeList1.SettingsEditing.AllowNodeDragDrop = true; //ASPxTreeList1.ProcessDragNode += new DevExpress.Web.ASPxTreeList.TreeListNodeDragEventHandler(ASPxTreeList1_ProcessDragNode); ASPxTreeList1.CellEditorInitialize += new DevExpress.Web.ASPxTreeList.TreeListColumnEditorEventHandler(ASPxTreeList1_CellEditorInitialize); //ASPxTreeList1.NodeValidating += new DevExpress.Web.ASPxTreeList.TreeListNodeValidationEventHandler(ASPxTreeList1_NodeValidating); //ASPxTreeList1.NodeInserting += new DevExpress.Web.Data.ASPxDataInsertingEventHandler(ASPxTreeList1_NodeInserting); ASPxTreeList1.NodeUpdating += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(ASPxTreeList1_NodeUpdating); //ASPxTreeList1.NodeDeleting += new DevExpress.Web.Data.ASPxDataDeletingEventHandler(ASPxTreeList1_NodeDeleting); //ASPxTreeList1.HtmlRowPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventHandler(ASPxTreeList1_HtmlRowPrepared); //ASPxTreeList1.HtmlDataCellPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlDataCellEventHandler(ASPxTreeList1_HtmlDataCellPrepared); //ASPxTreeList1.ParseValue += new DevExpress.Web.Data.ASPxParseValueEventHandler(ASPxTreeList1_ParseValue); }