How to Add Nodes in the TreeView Programmatically

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);

Next Recommended Reading Binding TreeView Dynamically in ASp.NET