Collapsed Node Checked Problem

2 posts, 0 answers
  1. Ted
    Ted avatar
    3 posts
    Member since:
    Aug 2012

    Posted 28 Aug 2012 Link to this post


    I have a function that iterates through all the nodes and places the checked nodes into a list. The problem is that it will miss any child nodes of collapsed parents because the parents are created on the server side with Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack.

    I believe what is happening is that because these nodes are defined requiring a callback, that their children are not written out to the browser until that AJAX callback is fired. Because of this, they do not come up in the tree.get_allNodes call I use to iterate through all the nodes at the time I use it because the parent nodes in question have not been expanded (i.e., the child nodes in question have not been added to the document).

    Forcing all the nodes to expand prior to checking for checked nodes works, but is unwieldy.

    Does anyone have any suggestions or ideas about how I might work around this? I'm not that familiar with using this control, so I thought maybe a more experienced user might be able to guide me in the right direction.

    Any help appreciated.


  2. Bozhidar
    Bozhidar avatar
    1095 posts

    Posted 30 Aug 2012 Link to this post

    Hi Ted,

    The get_allNodes() is a client function that counts the nodes that are currently present in the TreeView's client object. When using LoadOnDemand the nodes are added dynamically when requested. Therefore it's not possible to get a reference to all client objects, without them first being populated.
    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