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

RadContextMenu cannot be converted to RadDropDownMenu

3 Answers 118 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 2
Mark asked on 30 Oct 2012, 01:58 PM
Win 7 - 64bit,
Telerik WinForms Controls 2012.2.912.40
Using VB.net

Hello:

I placed a RadContextMenu on a Form
I then attempted to associate the RCM to a RadGridView in the ContextMenuOpening Event...

 

 


Private
Sub RGV_ContextMenuOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs)

 

    e.ContextMenu =

 

Me.RadContextMenuForGrids

 

End

 

 

Sub

 

Why is the compiler seeing the 2 objects as being different.  Here is the error?

RadContextMenu cannot be converted to RadDropDownMenu?

Thanks,
Mark

3 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 2
answered on 30 Oct 2012, 03:07 PM
Followup

The reference e.ContextMenu within the ContextMenuOpening event appears not to be a RadContextMenu but rather a RadDropDownMenu....this was causing my problem.  I've retyped by menu variable to a RadDropDownMenu and will see if this works. 

I'll leave the post open until I can resolve this and post my solution.
Mark
0
Mark
Top achievements
Rank 2
answered on 31 Oct 2012, 08:16 PM
Yes....you need to create a variable as a RadDropDownMenu
0
Accepted
Stefan
Telerik team
answered on 02 Nov 2012, 08:31 AM
Hello Mark,

Thank you for writing.

You should assign the context menu as follows:
e.ContextMenu = contextMenu1.DropDown

More information about the context menus in the gird is available here: http://www.telerik.com/help/winforms/gridview-context-menus-custom-context-menus.html.

I hope this helps.
 
All the best,
Stefan
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
GridView
Asked by
Mark
Top achievements
Rank 2
Answers by
Mark
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or