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

Is it possible to have a context sensitive ContextMenu?

3 Answers 133 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Derek Smith
Top achievements
Rank 1
Derek Smith asked on 20 Jan 2011, 03:39 AM
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

3 Answers, 1 is accepted

Sort by
0
Derek Smith
Top achievements
Rank 1
answered on 20 Jan 2011, 09:25 PM
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
0
Derek Smith
Top achievements
Rank 1
answered on 21 Jan 2011, 06:00 PM
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
0
Petar Mladenov
Telerik team
answered on 26 Jan 2011, 07:04 PM
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>>
Tags
ContextMenu
Asked by
Derek Smith
Top achievements
Rank 1
Answers by
Derek Smith
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or