Get number of nodes

4 posts, 1 answers
  1. Giorgos
    Giorgos avatar
    18 posts
    Member since:
    Apr 2013

    Posted 17 Oct 2013 Link to this post

    Is there any way to get the number of nodes an object of type RadDropDwonTree contains?
  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Oct 2013 Link to this post

    Hi Giorgos,

    I guess you want to access the number of nodes in the RadDropDownTree. Please check the following JavaScript code.

    <script type="text/javascript">
        function getNodeCount() {
            var raddropdowntree = $find('<%=RadDropDownTree1.ClientID %>');
            alert("Count " + raddropdowntree.get_embeddedTree().get_allNodes().length);

  3. DevCraft R3 2016 release webinar banner
  4. Sandeep
    Sandeep avatar
    13 posts
    Member since:
    Jan 2016

    Posted 14 Mar Link to this post

    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



  5. Nencho
    Nencho avatar
    1446 posts

    Posted 16 Mar Link to this post

    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.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top