Articles in this section
Category / Section

How to add nodes in the treeview programmatically?

1 min read

 

Nodes can be added programmatically as follows:

C#

TreeViewNode rootNode=new TreeViewNode();

rootNode.Text="MailBox";

rootNode.Expanded=true;

rootNode.ImagePath="root.gif";

TreeView1.Items.Add(rootNode);

VB

rootNode As TreeViewNode = New TreeViewNode()

rootNode.Text="MailBox"

rootNode.Expanded=True

rootNode.ImagePath="root.gif"

TreeView1.Items.Add(rootNode)

Note: TreeViewNode class is under the namespace Syncfusion.Web.UI.WebControls.Tools

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied