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

Add Items to Single RadContextMenu based on Target

1 Answer 123 Views
Menu
This is a migrated thread and some comments may be shown as answers.
johauna
Top achievements
Rank 1
johauna asked on 27 Jan 2011, 08:08 PM
I want to use a single RadContextMenu on a page that has a RadTabStrip with multiple pages and RadGrids and other controls on each RadPageView.  I want to have the RadContextMenu connected to certain controls like Grids and other controls so that when the user right clicks on the given control, server code behind will figure out what control is using the RadContextMenu and add the correct Items for that given control.

Is this possible or do I need multiple Context menus, each set to the given control. 

I just cannot get the target that is trigering the menu.  Any help would be great.

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 01 Feb 2011, 10:41 AM
Hello Johauna,

In general a context menu is shown on the client and because of that reason, there is no server-side functionality of determining on which element it's about to show. You could subscribe to OnClientShowing or OnClientShown and find the DOM element of its target.

So the best approach in your case is to have multiple context menus.

Kind regards,
Dimitar Terziev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Menu
Asked by
johauna
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or