4 Answers, 1 is accepted
0
Accepted
Hi Axel,
Thank you for writing.
To disable or customize the context menu you can use the DropDownOpening event. If you want to disable it you can just cancel the opening like this:
Also with the following code snipped you can remove a specific item for example:
Please let me know if there is something else I can help you with.
Regards,
Dimitar
Telerik
Thank you for writing.
To disable or customize the context menu you can use the DropDownOpening event. If you want to disable it you can just cancel the opening like this:
void
RadContextMenu_DropDownOpening(
object
sender, CancelEventArgs e)
{
e.Cancel =
true
;
}
Also with the following code snipped you can remove a specific item for example:
void
RadContextMenu_DropDownOpening(
object
sender, CancelEventArgs e)
{
foreach
(var item
in
radPdfViewer1.RadContextMenu.Items)
{
if
(item.Text ==
"&Next Page"
)
{
item.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
}
}
}
Please let me know if there is something else I can help you with.
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Axel
Top achievements
Rank 1
answered on 25 Nov 2013, 10:10 AM
That works! Thank you!
0
Damien
Top achievements
Rank 1
answered on 18 Apr 2018, 07:50 AM
Sorry to jump pin on this, but I have tried to find anywhere to use your code to disable the right-click context menu, and I can't find it.
Is this still relevant, or am I looking at it all wrong?
thanks.
Damien
0
Hello Damien,
Yes, this code still works. Here is how to subscribe to the event:
Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
Yes, this code still works. Here is how to subscribe to the event:
public
RadForm1()
{
InitializeComponent();
radPdfViewer1.RadContextMenu.DropDownOpening += RadContextMenu_DropDownOpening;
}
private
void
RadContextMenu_DropDownOpening(
object
sender, CancelEventArgs e)
{
e.Cancel =
true
;
}
Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.