RadTreeNode.ParentNode is Read Only

3 posts, 0 answers
  1. Eric
    Eric avatar
    1 posts
    Member since:
    Mar 2011

    Posted 21 Apr 2011 Link to this post

    Hi,
    Can you please correct me where I'm wrong and educate me where I need it here -  I've just discovered that the
    Parent Node property of the RadTreeNode object is read-only and a couple things come to mind.

    1.
    I discovered this after writing some recursive sql to retrieve an entire branch (all descendants, all levels) of a root node.  I populate my treeview via LoadOnDemand->WebMethod approach and in certain scenarios I want the option to retrieve either one level deep or the entire branch. I intended to populate the parentnode values as I built the tree but now see I cannot do that.
    Do I have any options?

    2.
    It also seems that in a LoadOnDemand scenario, in order to re-establish your CurrentNode positioning (Selected, Focused, and In View) after a page reload you would have to (if Current Node was not a root node) load down the branch at
    least to the level of the Current Node in order to establish positioning. Am I missing something? Is there a standard or best-practice approach to accomplishing this?

    Why is Parent Node read-only? If the source code is available is it reasonable
    to consider my own version where parent node is not read-only?

    Thanks!
    Eric

  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 22 Apr 2011 Link to this post

    Hello Eric,

    RadTreeView support many types of Data Sources and Data Binding. Here is a nice article that lists all supported types of Data Binding: http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-overview.html

    About the expanded state of the TreeView on reload of the page:
     - My suggestion is not to use Load On Demand if you are going to need the page to save the expansion of RadTreeView. Perhaps you are facing a scenario with RadTreeView on a MasterPage with content pages assigned as NavigateUrls to the nodes of the TreeView. And if you navigate to a certain page, you need to be able to expand the TreeView accordingly. If your case is similar (or same), and if there are as much as hundreds not thousands of nodes, the performance should not be harmed too badly.

    About the ParentNode being Read-only:
     - We try to enforce good practices where possible and for that reason the creation and adding of a node as a child to another node happens strictly and only in a single way - instantiate the node and add it to the nodes collection. The ParentNode is added only for users convenience when navigation through the tree-structure is required (especially top-down - from leave-nodes to root).


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Darren
    Darren avatar
    1 posts
    Member since:
    Oct 2017

    Posted 05 Oct Link to this post

    I want to select the node 

    This following code requires a id to search for but I can not assign an Id to the RadTreeNode because it is ReadOnly.

    Please help me. I want to be able to have certain node opened by entering parameters but I do not know how to select the nodes.

    var node = rootNodes.FindNodeByValue(linkID);

    This code fails too because it is Readonly

    AlbumRTV.SelectedNode = AlbumRTV.Nodes[0]; 

Back to Top