Disable/customize context menu in PdfViewer?

3 posts, 1 answers
  1. Axel
    Axel avatar
    2 posts
    Member since:
    Nov 2013

    Posted 21 Nov 2013 Link to this post

    Hi,

    how can one completely disable or customize the context menu in the Pdf Viewer control?

    Thanks!
  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 22 Nov 2013 Link to this post

    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:
    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. 

    Regards,
    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Axel
    Axel avatar
    2 posts
    Member since:
    Nov 2013

    Posted 25 Nov 2013 Link to this post

    That works! Thank you!
Back to Top