You can create unbound WebTreeView using editor or server side code.
This topic will show you how to implement the above scenario.
To create unbound WebTreeView using designer
- Right click on WebTreeView instance and choose WebTreeView.NET
Designer.
- Click the Tree Editor tab.
- Click the "Add a root node" icon to add root nodes, select
the new added node to set its properties.
- You can also add child nodes for the newly added nodes by clicking the "Add
a child node" icon, select the new added node to set its properties.
- Press Apply >> OK Button and run the project.
To create unbound WebTreeView using server side code
- Drag WebTreeView instance from ToolBar to WebForm.
- On Page_Load event handler, add the following code:
protected void Page_Load(object sender, EventArgs e)
{
WebTreeViewNode nodeRoot = new WebTreeViewNode();
nodeRoot.Text = "Personal Folders";
nodeRoot.Image = "./Images/PersonalFolders.gif";
nodeRoot.Expanded = true;
WebTreeViewNode nodeParent = new WebTreeViewNode();
nodeParent.Text = "Deleted Items";
nodeParent.Image = "./Images/DeletedItems.gif";
nodeRoot.Nodes.Add(nodeParent);
WebTreeViewNode nodeParent2 = new WebTreeViewNode();
nodeParent2.Text = "Drafts";
nodeParent2.Image = "./Images/Drafts.gif";
nodeRoot.Nodes.Add(nodeParent2);
WebTreeViewNode nodeParent3 = new WebTreeViewNode();
nodeParent3.Text = "Inbox";
nodeParent3.Image = "./Images/Inbox.gif";
nodeRoot.Nodes.Add(nodeParent3);
WebTreeViewNode nodeParent4 = new WebTreeViewNode();
nodeParent4.Text = "Junk E-mail";
nodeParent4.Image = "./Images/JunkEmail.gif";
nodeRoot.Nodes.Add(nodeParent4);
WebTreeViewNode nodeParent5 = new WebTreeViewNode();
nodeParent5.Text = "Outbox";
nodeParent5.Image = "./Images/Outbox.gif";
nodeRoot.Nodes.Add(nodeParent5);
WebTreeViewNode nodeParent6 = new WebTreeViewNode();
nodeParent6.Text = "RSS Feeds";
nodeParent6.Image = "./Images/RSSFeeds.gif";
nodeRoot.Nodes.Add(nodeParent6);
WebTreeViewNode nodeParent7 = new WebTreeViewNode();
nodeParent7.Text = "Sent Items";
nodeParent7.Image = "./Images/SentItem.gif";
nodeRoot.Nodes.Add(nodeParent7);
WebTreeViewNode nodeParent8 = new WebTreeViewNode();
nodeParent8.Text = "Search Folders";
nodeParent8.Image = "./Images/SearchFolders.gif";
WebTreeViewNode nodeLeaf = new WebTreeViewNode();
nodeLeaf.Text = "Categorized Mail";
nodeLeaf.Image = "./Images/SearchFolders.gif";
nodeParent8.Nodes.Add(nodeLeaf);
WebTreeViewNode nodeLeaf2 = new WebTreeViewNode();
nodeLeaf2.Text = "For Follow Up";
nodeLeaf2.Image = "./Images/SearchFolders.gif";
nodeParent8.Nodes.Add(nodeLeaf2);
WebTreeViewNode nodeLeaf3 = new WebTreeViewNode();
nodeLeaf3.Text = "Large Mail";
nodeLeaf3.Image = "./Images/SearchFolders-copy.gif";
nodeParent8.Nodes.Add(nodeLeaf3);
WebTreeViewNode nodeLeaf4 = new WebTreeViewNode();
nodeLeaf4.Text = "Unread Mail";
nodeLeaf4.Image = "./Images/SearchFolders-copy.gif";
nodeParent8.Nodes.Add(nodeLeaf4);
nodeRoot.Nodes.Add(nodeParent8);
WebTreeView2.Nodes.Add(nodeRoot);
WebTreeViewNode nodeRoot2 = new WebTreeViewNode();
nodeRoot2.Text = "Archieve Folders";
nodeRoot2.Image = "./Images/ArchiveFolders.gif";
WebTreeViewNode nodeParent9 = new WebTreeViewNode();
nodeParent9.Text = "Deleted Items";
nodeParent9.Image = "./Images/DeletedItems.gif";
nodeRoot2.Nodes.Add(nodeParent9);
WebTreeViewNode nodeParent10 = new WebTreeViewNode();
nodeParent10.Text = "Sent Items";
nodeParent10.Image = "./Images/SentItem.gif";
nodeRoot2.Nodes.Add(nodeParent10);
WebTreeViewNode nodeParent11 = new WebTreeViewNode();
nodeParent11.Text = "Search Folders";
nodeParent11.Image = "./Images/SearchFolders.gif";
nodeRoot2.Nodes.Add(nodeParent11);
WebTreeView2.Nodes.Add(nodeRoot2);
}
|
- Run the project.