how to enable context menu by default to all controls ?

4 posts, 0 answers
  1. Ravi
    Ravi avatar
    97 posts
    Member since:
    Jun 2012

    Posted 09 Jul 2013 Link to this post

    Hi There,

    I have the following two requirements:

    1. Wanted to add help as a menu item to RadContextMenu item this will be a default menu item, i wanted to do it using a style/controltemplate.

    2. wanted to enable Radcontextmenu by default so help will display on all controls when ever user right clicks on any control.

    can you please tell me how i can do this?

    Thanks in advance.

    Regards,
    Srinivas.
  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 09 Jul 2013 Link to this post

    Hello Srinivas,

    You can attach RadContextMenu to your UserControl and you will be able to open it no matter where you've clicked in it. I'm sending you a sample project demonstrating this behavior. Please check it and inform us if you have any problems or concerns.

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    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 WPF is Visual Studio 2017 Ready
  4. Ravi
    Ravi avatar
    97 posts
    Member since:
    Jun 2012

    Posted 10 Jul 2013 Link to this post

    Hi Rosen Vladimirov

    Thank you for your help and sample project. 

    If we use it on USerControl then the context menu will display on every where include blank areas, but we wanted to display it only on controls, example:textbox etc.. 

    is there any way that we can display context menu by default item on context menu and we will enable context menu for all controls by default ? 

    Regards,
    Srinivas.

  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 10 Jul 2013 Link to this post

    Hello Srinivas,

    One way to achieve this is to create a default Style where you attach RadContextMenu. After that you can create different styles for the controls you are using and base them on the default style. I've modified my project to show you how to achieve this. Please check it and inform us if you have any problems or concerns.

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    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 >>
Back to Top