The following code shows how to add Groups to the WebListBar at runtime, as well as how to associate a UserControlURL to each Group and add a WebTree to each UserControl. This could be helpful in customizing what the individual user will see displayed in each Group
this.UltraWebListbar1.Groups.Add("Group 1", "One");
this.UltraWebListbar1.Groups.Add("Group 2", "Two");
this.UltraWebListbar1.Groups[0].UserControlUrl = "WebUserControl1.ascx";
this.UltraWebListbar1.Groups[1].UserControlUrl = "WebUserControl1.ascx";
//********Group 1
WebUserControl1 UC1;
UC1 = (WebUserControl1)this.UltraWebListbar1.Groups[0].UserControl;
UltraWebTree myTree = new UltraWebTree();
myTree.ID = "myTree";
UC1.Controls.Add(myTree);
UltraWebTree ucTree;
ucTree = (UltraWebTree)UC1.FindControl("myTree");
ucTree.Nodes.Add("My New Node 1");
ucTree.Nodes.Add("My New Node 2");
ucTree.Nodes.Add("My New Node 3");
//********Group 2
WebUserControl1 UC2;
UC2 = (WebUserControl1)this.UltraWebListbar1.Groups[1].UserControl;
UltraWebTree myTree2 = new UltraWebTree();
myTree2.ID = "myTree2";
UC2.Controls.Add(myTree2);
UltraWebTree ucTree2;
ucTree2 = (UltraWebTree)UC2.FindControl("myTree2");
ucTree2.Nodes.Add("My New Node A");
ucTree2.Nodes.Add("My New Node B");
ucTree2.Nodes.Add("My New Node C");
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment