RunTime treeview doesn't expand

4 posts, 0 answers
  1. Jean-Marc Windholz
    Jean-Marc Windholz avatar
    42 posts
    Member since:
    Sep 2009

    Posted 30 Mar 2010 Link to this post

    In  RadPanelBar1_ItemDataBound event I create a redtreeview (at runtime)

    Dim item_TreeView As New RadTreeView

    item_TreeView.ID = "item_TreeView"

    item_TreeView.DataSourceID = "ObjectDataSource2"

    item_TreeView.DataFieldID = "IDCategory"

    item_TreeView.DataFieldParentID = "IDParent"

    item_TreeView.DataTextField = "Name"

    item_TreeView.DataValueField = "IDCategory"

    item_TreeView.Skin = "Default"

    item_TreeView.ExpandAllNodes()

    itemPanel.Controls.Add(item_TreeView)

    ----------------

    My goal is to expand all tree nodes, despite this

    item_TreeView.ExpandAllNodes()

    it doesn’t happen, it remains collapsed

    How can I do that?

    Thank you so much

     

     

     

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Mar 2010 Link to this post

    Hello,

    Try attaching 'OnDataBound' event to dynamically created treeview and try the code for expanding all the nodes.

    CS:

     
        void RadTreeView1_DataBound(object sender, EventArgs e)  
        {  
            (sender as RadTreeView).ExpandAllNodes();  
        } 

    -Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jean-Marc Windholz
    Jean-Marc Windholz avatar
    42 posts
    Member since:
    Sep 2009

    Posted 31 Mar 2010 Link to this post

    Can you give me an example?
    how do I call the event 'OnDataBound' of the tree that I created dynamically?
    thanks!
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 02 Apr 2010 Link to this post

    Hello Jean-Marc Windholz,

    Here is how you can subscribe to the DataBound event of the treeview at runtime:

    item_TreeView.DataBound += new EventHandler(RadTreeView1_DataBound);


    Kind regards,
    Veskoni
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top