This is a migrated thread and some comments may be shown as answers.

Collapsed Node Checked Problem

1 Answer 42 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ted
Top achievements
Rank 1
Ted asked on 28 Aug 2012, 10:07 PM
Hi,

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.

Thanks,
Ted





1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 30 Aug 2012, 07:29 AM
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.
 
Regards,
Bozhidar
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.
Tags
TreeView
Asked by
Ted
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or