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

[Solved] Integrate the RAD GridView with the RAD context menu

2 Answers 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marian
Top achievements
Rank 1
Marian asked on 24 Feb 2008, 03:00 PM
Hi,

I am trying to open a context menu when right click any column from a RAD GridView. I couldn't give The RAD GridView Column as a target for the context menu.

I think it is not permited also to set the ContextMenuTagNameTarget  with an asp or RAD tag name, i think it is ok only with HTML Tags, please validate.

<telerik:ContextMenuTagNameTarget TagName="Columns"

/>

<telerik:ContextMenuTagNameTarget TagName="telerik

:GridBoundColumn" />




I have tried to use the client event OnColumnContextMenu and handle the function ColumnContextMenu to make it show the context menu

<ClientEvents OnColumnContextMenu="ColumnContextMenu" />



var

contextMenu = document.getElementById("<%= DWSRadContextMenu.ClientID %>");


contextMenu.Show();

but I recieve a javascript error that the contextMenu object doesn't support that function, also I have download several examples with the ASP Menu not the Prometheus,and they use the Show() function, and the ShowAt function.

Please advice.

Kind regards.

2 Answers, 1 is accepted

Sort by
0
Marian
Top achievements
Rank 1
answered on 24 Feb 2008, 04:51 PM
There is another issue, I have create a context menu  that has a Grid as the target column. it shows the context menu at the first run, but after I run the search the rows are added to the Grid, i tried to right click it doesn't show the context menu. i tried to sort then right click again it appear.
0
Sebastian
Telerik team
answered on 27 Feb 2008, 03:44 PM
Hello Marian,

You need to associate the context menu with the grid by specifying the id of the grid as ContextMenuControlTarget in the Targets collection of RadContextMenu, namely:

<Targets>    
     <telerik:ContextMenuControlTarget ControlID="<MyRadGridId>" />    
</Targets>     
 

Furthermore, the client code conventions for our Prometheus controls are a bit different compared to the Classic counterparts of RadGrid and RadMenu. Review the article from the online help created to utilize the transition process between the relevant control and its Prometheus version here:

http://www.telerik.com/help/radcontrols/prometheus/?grdMigrationToPrometheus.html
http://www.telerik.com/help/radcontrols/prometheus/?menu_OverviewMigrating.html

Finally, the code snippets from this KB article along with the RadControls Prometheus test project attached at the bottom can be a good starting point for your implementation:

http://www.telerik.com/support/kb/article/b454K-kgt-b454T-cbb-b454c-cbb.aspx

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Marian
Top achievements
Rank 1
Answers by
Marian
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or