FindNodeByValue then Nodes.Add a child?

2 posts, 0 answers
  1. Greg
    Greg avatar
    1 posts
    Member since:
    Feb 2012

    Posted 02 Jul 2012 Link to this post

    I've used a SQL CTE to build a table that represents my hierarchy and now I'm trying to loop through those records to find the parent node, create a new node object and then append that new node object as a child of the parent node I found.

    I've got a radtreeview with a parent node with a value of 0.  I've tried accomplishing this two ways - neither works.

    The following compiles without error, but doesn't add the newly created CurrentNode to the node I found in objMyTreeView.  

    The following will find the parent node, but when I add the CurrentNode to it - I'm adding it to the ParentNode object - not the actual parent node in objMyTreeView.  
    RadTreeNode ParentNode = objMyTreeView.FindNodeByValue("0");

    This seems like it should be simple - find the node with the value of the current node's parent, then add my current node as a child of the found node.  Any advice offered would be appreciated.  I must be overlooking something obvious.

    ~ Greg

  2. Plamen
    Plamen avatar
    2724 posts

    Posted 05 Jul 2012 Link to this post

    Hi Greg,

    I am attaching a sample web page based on the code that you pasted and on this on-line demo that worked properly at my side. Please review it and let me know if you have further questions.

    Hope this will be helpful.

    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top