3 Answers, 1 is accepted
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 Oct 2013, 10:47 AM
Hi Giorgos,
I guess you want to access the number of nodes in the RadDropDownTree. Please check the following JavaScript code.
JavaScript:
Thanks,
Shinu.
I guess you want to access the number of nodes in the RadDropDownTree. Please check the following JavaScript code.
JavaScript:
<script type=
"text/javascript"
>
function
getNodeCount() {
var
raddropdowntree = $find(
'<%=RadDropDownTree1.ClientID %>'
);
alert(
"Count "
+ raddropdowntree.get_embeddedTree().get_allNodes().length);
}
</script>
Thanks,
Shinu.
0
Sandeep
Top achievements
Rank 1
answered on 14 Mar 2016, 10:14 AM
Hello ,
I need same functionality to count the number of nodes in raddropdowntree from serverside.
I didnt get any option for it.
also can not set the value by selectedIndex
0
Hello Sandeep,
In order to get the Nodes count you can still use the Embedded TreeView control of the DropDownTree, but at server-side. In addition, regarding the SelectedIndex that you need to set - you can access the NodesCollection (index-based) of the Embedded TreeView and use the SyncEmbeddedTree method.
In the attachment you can find a simple example demonstrating the above suggested approaches.
Hope this would help.
Regards,
Nencho
Telerik
In order to get the Nodes count you can still use the Embedded TreeView control of the DropDownTree, but at server-side. In addition, regarding the SelectedIndex that you need to set - you can access the NodesCollection (index-based) of the Embedded TreeView and use the SyncEmbeddedTree method.
In the attachment you can find a simple example demonstrating the above suggested approaches.
Hope this would help.
Regards,
Nencho
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.