selected nodes count problem

4 posts, 1 answers
  1. Mario
    Mario avatar
    75 posts
    Member since:
    Jun 2009

    Posted 28 Nov 2010 Link to this post

    i want to display the number of currently selected nodes of my radTreeView (clientside).

    so i have the nodeClicked event working fine.

    var tree = $find("<%= radTreeView.ClientID %>");
    var nodes = tree.get_selectedNodes();

    i get the treeview object. i also got a object from the get_selectedNodes method.

    But i cant get the Count fomr this array of nodes.

    I tried .Count() .count() and get_count(), always getting an exception, stating that this object does'nt own such a method.

    What may be helpfull?

    thanks Mario
  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Nov 2010 Link to this post

    Hello Mario,

    Use nodes.length for getting the count of the nodes.

    Client code:
    function getSelected() {
        var tree = $find("<%= treeview1.ClientID %>");
        var nodes = tree.get_selectedNodes();

  3. Daniel
    Daniel avatar
    1 posts
    Member since:
    Nov 2012

    Posted 10 Feb 2016 in reply to Shinu Link to this post

    function nodeSelecting(sender, args) {
    var nodes = sender.get_selectedNodes();

    Where sender is a radtreeview,

    It always returns 0, am I missing a property somewhere?


    Thank You

  4. Eyup
    Eyup avatar
    3618 posts

    Posted 15 Feb 2016 Link to this post

    Hi Daniel,

    Please make sure that the time for executing this logic is appropriate and the nodeSelecting function is not called too. You can check that by temporarily transferring your script logic to a button client-side click handler.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top