Is it possible to have a context sensitive ContextMenu?

4 posts, 0 answers
  1. Derek Smith
    Derek Smith avatar
    3 posts
    Member since:
    Mar 2010

    Posted 19 Jan 2011 Link to this post

    I am using the RadTreeView control and was wondering if it was possible to have a context sensitive ContextMenu.  I have a tree with different types of items and I would like to have different ContextMenu content based on the type of item that was clicked.  I looked at the documenation and it doesn't seem this is possible.  Is it?

    Thanks.

    Derek
  2. Derek Smith
    Derek Smith avatar
    3 posts
    Member since:
    Mar 2010

    Posted 20 Jan 2011 Link to this post

    I ended up figuring out how to do this.  What I did was use the RadContextMenu inside the data templates that were defining the data.

    Derek
  3. UI for WPF is Visual Studio 2017 Ready
  4. Derek Smith
    Derek Smith avatar
    3 posts
    Member since:
    Mar 2010

    Posted 21 Jan 2011 Link to this post

    Actually this ended up not working so well.  I really need a way to have a RadContextMenu change MenuItems based on the type of item that was clicked.  Please Help.  I am wasting a ton of time on something that should be pretty simple.

    Thanks.

    Derek
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Jan 2011 Link to this post

    Hi Derek Smith,

    You can examine the attached projects which demonstrate how to change the context menu dynamically. One of it uses ItemTemplateSelector for the Contextmenu, the other generates the Contextmenu in code behind. This should be a good starting point. Feel free to ask if you need further assistance.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top