Add New RadTreeView into RadPanelBar Programmatically

2 posts, 0 answers
  1. Jimmy
    Jimmy avatar
    2 posts
    Member since:
    Feb 2014

    Posted 11 Dec 2014 Link to this post

    Dear Telerik Admin, 

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

    Thanks.
  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 16 Dec 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top