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

Modify RadconextMenu Items In Function of the created node

5 Answers 43 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Hind
Top achievements
Rank 1
Hind asked on 04 Nov 2011, 11:16 AM
Hello,

I have a treeview and its context menu for which i initialize its items at the design time .
I populate the treeview dynamically. For each node, i want to configure the context menu differently ( ex: Add new contextMenu Items, change their text...). Can I do it at the server side? It seems that the contextMenu is not proper to the node, but to all the treeview? And the modifications are applied to the contextMenus of all the TreeViewItems..

Thank You for Clarification.


5 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 04 Nov 2011, 12:13 PM
Hello Hind,

Please take a look at the following forum posts and help article where you can find examples how this could be achieved:

http://www.telerik.com/help/aspnet-ajax/treeview-context-menu-runtime.html
http://www.telerik.com/community/forums/aspnet-ajax/treeview/context-menu-according-to-the-node.aspx#1767873
http://www.telerik.com/community/forums/aspnet-ajax/treeview/119788-multiple-context-menu-in-radtreeview.aspx#468680

Kind regards,
Kate
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
Hind
Top achievements
Rank 1
answered on 04 Nov 2011, 02:03 PM
Hi Kate,
I have seen these documentations, but no one  doesn't response to my needs. In fact, I need to have the same contextMenu Fonctionallity as shown in this exemple  http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/contextmenu/defaultcs.aspx (Adapt the text of the same context menu in fuction of its node), but Server Side instead of Client Side. Is that possible?? If Yes, can I have a simulated case?

Thank You,

Hind
0
Hind
Top achievements
Rank 1
answered on 04 Nov 2011, 05:56 PM
Hello,
I Have also another problem when I set the text of the Context Menu Item dynamically. At the runtime I see that the value of the text is correctly setted, but in result the text of the conetxtmenu is not shown in the page.
You can check the attached screenshot to have a clearer idea of my problems.
Thank You for helping.

Hind
0
Hind
Top achievements
Rank 1
answered on 08 Nov 2011, 11:27 AM
Hello,

I think there is a server side disfunctionnality on the contextMenu for the TreeView.

I hope That You give more explanations about the issues I mentionned before.

I have treat my problem by using client side methods of the context menu to set the text of menu items and hide unwanted items. Notice that It was impossible to create these items client side due to the enormity of conditions on the menu items and the values of their fields to set.  I proceed to add Attributes to my MenuIems and Use these Attributes on the server side to do the requisite.

Thank You,


 
0
Kate
Telerik team
answered on 09 Nov 2011, 11:21 AM
Hi Hind,

Depending on different conditions that you can define according to your requirements you can assign various contextmenus for every single node of the RadTreeView control. Here I have attached a simple runnable page how this could be accomplished on the server side. Considering your other issue I am not quite sure why you can not get the text to show properly. Can you please clarify the version of the controls that you are using as well as some more details how to reproduce it? 

Greetings,
Kate
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
Tags
TreeView
Asked by
Hind
Top achievements
Rank 1
Answers by
Kate
Telerik team
Hind
Top achievements
Rank 1
Share this question
or