Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > TreeView > Select Multiple Nodes --> Select/Click events in server Side

Answered Select Multiple Nodes --> Select/Click events in server Side

Feed from this thread
  • Posted on Jan 25, 2012 (permalink)

    I have a RastreeView... such as:


    Every node has an attribute
    Folders has attribute["Type"] = "F"
    and documents has attribute["Type"] = "D"

    When create a TV for every node assign ContextMenu
    Document has --> document Context Menu
    Folder has --> Folder Context Menu

    I NEED change contextMenu if user do:
    -- click on Documents and Folders --> Change to COMMON MENU

    I do this in RastreeView ClickNode event , but does not work if I selected every node with Control+click or shift+click

    Where I can catch all selected nodes and change on runtime ContextMenu??

    regards

    Reply

  • Plamen Zdravkov Plamen Zdravkov admin's avatar

    Posted on Jan 30, 2012 (permalink)

    Hi Julieta,

    In the NodeClick event of RadTreeView the selected nodes are already changed so you need an event that will fire until the nodes are still selected. One possible way is to add new context menu item and change the context menu in  OnContextMenuItemClick.

    Hope this will be helpful.


    All the best,

    Plamen Zdravkov
    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

    Reply

  • Posted on Jan 30, 2012 (permalink)

    thanks Plamen Zdravkov!
    But I need do it in server side. I didn't found an events for this.
    Currently I use checkBoxes But if is possible I do when user select node....

    regards

    Reply

  • Answer Plamen Zdravkov Plamen Zdravkov admin's avatar

    Posted on Feb 2, 2012 (permalink)

    Hi Julieta,

     
    You can get the selected nodes in the onClientNodeClicking event as in the code bellow and send it to server through AjaxRequest:

    function OnClientNodeClicking(sender, args) {
     
                    sender.trackChanges;
                    for (var index in sender.get_selectedNodes()) {
     
                    alert(   sender.get_selectedNodes()[index].get_text());
                    }
                    sender.commitChanges;
     
                }

    Hope this will help.

    Regards,
    Plamen Zdravkov
    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

    Reply

  • Posted on Feb 2, 2012 (permalink)

    Thanks Plamen !
    U change all code and use Checkbox of treeview!

    regards

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > TreeView > Select Multiple Nodes --> Select/Click events in server Side
Related resources for "Select Multiple Nodes --> Select/Click events in server Side"

ASP.NET TreeView Features  |   Documentation   |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]