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

ContextMenu swallowing all mouse events

1 Answer 141 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin
Top achievements
Rank 1
Kevin asked on 06 May 2011, 08:06 PM
I need to use the ContextMenu in a way that allows me to also respond to a right click event on the item.

The application is a diagram based UI, where there are many items on a canvas.  When an item is right clicked, it should be selected first, then the contextmenu should open.

I am using the telerik method to adding a mouse handler :
Mouse.AddMouseDownHandler(componentArtBoard, componentArtboard_MouseDown, true);

Note that I am using it for the mouse DOWN.  On the same UIElement (componentArtboard), I have a RadContextMenu defined, with EventName set to 'MouseRightButtonUp'.

When I right click, the context menu somehow swallows the mouse down event, even though it is set to respond to MouseRightButtonUp.  Even more confusing is that the Mouse.AddMouseDownHandler above is set to also catch handled events.

I am at a loss here.  Is this a bug?

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 09 May 2011, 08:02 AM
Hello Kevin,

When we open RadContextMenu we add one additional Popup under the context menu which handles mousedown event and close radcontextmenu. We do this because there is no other way to know when user clicked outside context menu (which we need to know so that we can close the context menu).

This is why your code is not called - routed events does not go through Popups.

Once the platform is improved we will remove this popup. Until then I can recommend you is to manually open the context menu (e.g. create Popup and set its Child to be RadContextMenu and instead of RadContextMenu.IsOpen set popup.IsOpen=true).
This way you will have to manually close the menu and also you will have to manually implement boundary detection.

I hope that this is acceptable for you.

Kind regards,
Hristo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Menu
Asked by
Kevin
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or