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

Suppress/Disable Cut/Copy/Paste Context Menu

3 Answers 446 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 20 Oct 2010, 05:00 PM
We are having an issue with displaying only our custom context menu (do not want to show cut/copy/paste context menu) when the DropDownStyle is DropDown.  When the DropDownStyle is DropDownList then the context menu works as expected. 

On a right-click (or Apps key press: Keys.Apps) the cut/copy/paste context menu is shown for the editor textbox.  We were able to work around not showing the context menu for the mouse right-click action by absorbing the MouseDown event of the TextBox (

radDropDownList.DropDownListElement.TextBox.MouseDown += radDropDownListTextBox_MouseDown

 

) and then displaying our custom context menu.  We attempted to do a similar workaround by subscribing to the KeyDown event of the textbox editor component of the RadDropDownList, but we are unable to suppress the context menu.

Is there a way (or workaround) for suppressing the cut/copy/paste context menu that is shown for the RadDropDownList textbox editor component (especially for the Apps key press)? 

Thank you for any help and information you can provide.
Jeremy

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 20 Oct 2010, 08:51 PM
Hi,

Hopefully this will work and is really straightforward. Just replace the textbox control's context menu with a dummy one. E.g

In the Load event of your form
Dim textEditor As HostedTextBoxBase = DirectCast(Me.RadDropDownList1.Controls(0), HostedTextBoxBase)
textEditor.ContextMenu = New System.Windows.Forms.ContextMenu()

Hope that helps
Richard
0
Jeremy
Top achievements
Rank 1
answered on 21 Oct 2010, 03:10 PM
Thank you for the suggestion Richard.  That seemed to do the trick!

Jeremy
0
Richard Slade
Top achievements
Rank 2
answered on 21 Oct 2010, 03:14 PM
No problem. Glad it worked for you. 
RIchard
Tags
DropDownList
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Jeremy
Top achievements
Rank 1
Share this question
or