RadTreeView for ASP.NET

How to add controls to the node's Controls collection at run time Send comments on this topic.
Templates > How to add controls to the node's Controls collection at run time

Glossary Item Box

You can add controls directly to the Controls collection of the TreeNodes. The example below shows how to achieve the task:

Example:

C# Copy Code
RadTreeNode root1 = new RadTreeNode("root1");
TextBox textbox1 =
new TextBox();
root1.Controls.Add(textbox1);

RadTreeView1.Nodes.Add(root1);

RadTreeNode root2 =
new RadTreeNode("root2");
Label label1 =
new Label();
label1.Text =
"Label";
root2.Controls.Add(label1);

RadTreeView1.Nodes.Add(root2);
        
VB.NET Copy Code
Dim root1 As New RadTreeNode("root1")
Dim textbox1 As New TextBox()
root1.Controls.Add(textbox1)

RadTreeView1.Nodes.Add(root1)

Dim root2 As New RadTreeNode("root2")
Dim label1 As New Label()
label1.Text = "Label"
root2.Controls.Add(label1)

RadTreeView1.Nodes.Add(root2)

The result of the above code will be: