Ajax TreeView Expand Node issue

6 posts, 1 answers
  1. Sri
    Sri avatar
    22 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2009 Link to this post

    I am trying to expand all the nodes at runtime and the code is working perfectly. But the only issue I see is even though the node is expanded, the node is still shown with "+" (plus). How can I make a node to display with "-" (minus) when it is expanded at runtime?
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 18 Jun 2009 Link to this post

    Hello Sri,

    This should not be happening. Could  you please paste here the code you are using to expand the node? Also let us know which version are you using. There was a bug which lead to such behavior in older versions.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Sri
    Sri avatar
    22 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2009 Link to this post

    I am using 2009 Q1 Trail version of the controls.
    Below is the code:

     

    Private Sub ExpandSelectedNode(ByVal TNode As RadTreeNode)

     

    PopulateHierarchy(TNode,

    Me._PerspectiveId, Int32.Parse(TNode.Value))

     

    TNode.ExpandChildNodes()

    TNode.Expanded =

    True

     

     

    For Each TSubNode As RadTreeNode In TNode.Nodes

     

    ExpandSelectedNode(TSubNode)

     

    Next

     

    End Sub
  4. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 18 Jun 2009 Link to this post

    Hi Sri,

    Make sure you also set the ExpandMode to ClientSide. Otherwise the treeview will think the node should be populated on demand and render the expand image (+).

    Sincerely yours,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Sri
    Sri avatar
    22 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2009 Link to this post

    As of now I have the following for the Expand Mode for the Node:

    TreeNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack


    The moment I change that to Client Side, it doesnt show up the + symbol to expand on demand. But the button click to expand the menu works and now it shows - symbol for the nodes expanded.

    I need expand on demand also to work.
  6. Sri
    Sri avatar
    22 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2009 Link to this post

    It is working now. Your reply helped me to understand how the Expand Mode works.
    I intially set it to ServerSideCallBack and when I click the button I changed it to ClientSide. Now load on demand works and as well as when the "Expand all" button clicked, they show with minus symbol.

    Thanks
    Sri K Gamini.

     

Back to Top