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

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

4 Answers 50 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
July
Top achievements
Rank 2
July asked on 25 Jan 2012, 06:10 PM
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

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 30 Jan 2012, 05:23 PM
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
0
July
Top achievements
Rank 2
answered on 30 Jan 2012, 06:10 PM
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
0
Accepted
Plamen
Telerik team
answered on 02 Feb 2012, 05:31 PM
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
0
July
Top achievements
Rank 2
answered on 02 Feb 2012, 05:47 PM
Thanks Plamen !
U change all code and use Checkbox of treeview!

regards
Tags
TreeView
Asked by
July
Top achievements
Rank 2
Answers by
Plamen
Telerik team
July
Top achievements
Rank 2
Share this question
or