private void CreateNode(DevExpress.XtraTreeList.TreeList tl) { tl.BeginUnboundLoad(); // Create a root node DevExpress.XtraTreeList.Nodes.TreeListNode parentForRootNodes = null; DevExpress.XtraTreeList.Nodes.TreeListNode rootNode2 = tl.AppendNode(new object[] { "Thiết bị quản lý theo số lượng", 0 }, parentForRootNodes); DevExpress.XtraTreeList.Nodes.TreeListNode rootNode = tl.AppendNode(new object[] { "Thiết bị quản lý theo cá thể", 1 }, parentForRootNodes); // Create a child for a root Node tl.AppendNode(new object[] { "Thiết bị đang được sử dụng", 2 }, rootNode); tl.AppendNode(new object[] { "Thiết bị chưa được sử dụng", 3 }, rootNode); tl.EndUnboundLoad(); }
public static void LoadDefaultNodes(DevExpress.XtraTreeList.TreeList Tree, NICSQLTools.Views.Main.MainTilesFrm MainFrm) { Tree.Nodes.Clear(); //NICSQLTools.Forms.Main.MainTilesFrm MainFrm = (NICSQLTools.Forms.Main.MainTilesFrm)Parent.Parent.Parent; Tree.BeginUnboundLoad(); // Create a root node . TreeListNode RootNode = Tree.AppendNode(new object[] { "Main", false, false, false, false, "Main" }, 0); ; //TreeListNode RootEditorNode = Tree.AppendNode(new object[] { "Editors", false, false, false, false }, RootNode); //TreeListNode RootQueriesNode = Tree.AppendNode(new object[] { "Queries", false, false, false, false }, RootNode); //TreeListNode RootRulesNode = Tree.AppendNode(new object[] { "Rules", false, false, false, false }, RootNode); //TreeListNode RootReportsNode = Tree.AppendNode(new object[] { "Reports", false, false, false, false }, RootNode); //TreeListNode RootDashBoardNode = Tree.AppendNode(new object[] { "DashBoard", false, false, false, false }, RootNode); ExtractTilesFromTileContainer(MainFrm.tileContainerMain, RootNode); ////RootEditorNode.Tag = "root"; RootQueriesNode.Tag = "root"; RootRulesNode.Tag = "root"; RootReportsNode.Tag = "root"; RootDashBoardNode.Tag = "root"; //foreach (DevExpress.XtraBars.Docking2010.Views.WindowsUI.Tile tile in MainFrm.tileContainerEditors.Items) // Tree.AppendNode(new object[] { tile.Document.Caption, false, false, false, false, tile.Document.ControlName }, RootEditorNode); //foreach (DevExpress.XtraBars.Docking2010.Views.WindowsUI.Tile tile in MainFrm.tileContainerQueries.Items) // Tree.AppendNode(new object[] { tile.Document.Caption, false, false, false, false, tile.Document.ControlName }, RootQueriesNode); //foreach (DevExpress.XtraBars.Docking2010.Views.WindowsUI.Tile tile in MainFrm.tileContainerRules.Items) // Tree.AppendNode(new object[] { tile.Document.Caption, false, false, false, false, tile.Document.ControlName }, RootRulesNode); //foreach (DevExpress.XtraBars.Docking2010.Views.WindowsUI.Tile tile in MainFrm.tileContainerReports.Items) // Tree.AppendNode(new object[] { tile.Document.Caption, false, false, false, false, tile.Document.ControlName }, RootReportsNode); //foreach (DevExpress.XtraBars.Docking2010.Views.WindowsUI.Tile tile in MainFrm.tileContainerDashboard.Items) // Tree.AppendNode(new object[] { tile.Document.Caption, false, false, false, false, tile.Document.ControlName }, RootDashBoardNode); Tree.EndUnboundLoad(); }