This is a migrated thread and some comments may be shown as answers.

Add New RadTreeView into RadPanelBar Programmatically

1 Answer 40 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jimmy
Top achievements
Rank 1
Jimmy asked on 12 Dec 2014, 05:36 AM
Dear Telerik Admin, 

Can you share a code for adding New RadTreeView into RadPanelBar programmatically on code behind in ASP.Net Vb.Net.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 16 Dec 2014, 10:43 PM
Hello Jimmy,

You can use the Controls collection of the preferable RadPanelItem and add the instance of the dynamically created RadTreeView in code behind. For example please consider the below implementation:

Protected Sub Page_Load(sender As Object, e As EventArgs)
    If Not IsPostBack Then
        AddTreeViewInPanelBar()
    End If
End Sub
 
Protected Sub AddTreeViewInPanelBar()
    Dim tree As New RadTreeView()
    tree.Nodes.Add(New RadTreeNode("Node 1"))
    tree.Nodes.Add(New RadTreeNode("Node 2"))
    tree.Nodes.Add(New RadTreeNode("Node 3"))
    tree.Nodes.Add(New RadTreeNode("Node 4"))
    tree.Nodes.Add(New RadTreeNode("Node 5"))
 
    RadPanelBar1.Items(0).Controls.Add(tree)
 
End Sub


Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PanelBar
Asked by
Jimmy
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or