This is a migrated thread and some comments may be shown as answers.
RadContextMenu EventName="MouseLeftButtonDown" doesn't work with SL3 DataGrid
5 Answers 143 Views
This is a migrated thread and some comments may be shown as answers.
Todd Millett
Top achievements
Rank 1
Todd Millett asked on 31 Aug 2009, 02:49 PM
This may be an issue with the way the Silverlight 3 DataGrid captures mouse events, but I'm looking for a work-around if possible.

When I hook up the RadContextMenu to a Silverlight 3 DataGrid control, if the user right-clicks on a row, the context menu displays correctly, and I am able to detect the row that was clicked on.

However, I also want this to work on the Mac.  The right-click equivalent on a Mac (Ctrl-LeftMouseClick) does not display the RadContextMenu -- it displays the Silverlight context menu.  Therefore, I intended to detect the platform the user was running on and if it was a Mac, I would set the key sequence for the RadContextMenu to (Alt-LeftMouseClick), since (Ctrl-LeftMouseClick) doesn't work.

I tried setting the EventName to "MouseLeftButtonDown" and the Modifier Key to ModifierKeys.Alt, but it did not work.  I tried dropping the ModifierKeys value, and it still did not work.  After much experimentation, I discovered that the "MouseLeftButtonDown" EventName does not display the ContextMenu on a Silverlight 3 DataGrid, whether on the Mac or on Windows.  Somehow the left-mouse-button-click event gets captured by the DataGrid, and never reaches the Telerik RadContextMenu control.

Any ideas on how to solve this?  The bottom line is that I need a way to display a context menu for the DataGrid on a Mac.

5 Answers, 1 is accepted

Sort by
0
Todd Millett
Top achievements
Rank 1
answered on 31 Aug 2009, 03:44 PM
The problem appears to be even more general than the DataGrid.  I can attach a right-click context menu to a Silverlight button, and it works fine on Windows, but not on the Mac.  While the Ctrl-LeftClick and Alt-LeftClick scenarios work in the online Demo on the Mac, they don't work when attaching the context menu to a control which already has a left-click event, such as a Button, or the DataGrid.

While we are impressed with the capabilities of the Telerik suite so far, we do need a solution that will work both on the Mac and on Windows.  If we can't work around this, it will be a deal-killer.
0
Kaloyan
Telerik team
answered on 02 Sep 2009, 01:22 PM
Hello Todd Millett,

We are sorry for the inconvenience caused. Unfortunately we are experiencing some problems when attaching to the right mouse click event on Mac(safari) browser. Also the current version of the RadContext menu is not catching the Click event, when it is attached to an element which handles the click event. We are planning to remove the limitation for the Q3 2009 release.

Regards,
Kaloyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Todd Millett
Top achievements
Rank 1
answered on 02 Sep 2009, 04:29 PM
Thanks for your response.  I look forward to the fix.  Ideally, for us, the Ctrl-LeftMouseClick would work on the Mac (in Safari or Firefox), since that is the experience that most Mac users would expect.
0
Doug
Top achievements
Rank 1
answered on 14 Jul 2011, 08:03 PM

 

<Telerik:RadContextMenu.ContextMenu>
    <Telerik:RadContextMenu x:Name="MyContextMenu" EventName="MouseLeftButtonDown"

FYI- this still doesn't work, I'm attaching it to a button but also tried a border - no joy.

 

 

0
Hristo
Telerik team
answered on 15 Jul 2011, 08:10 AM
Hello Doug,

We are not aware of such bug.
In order to work when EventName is MouseLeftButtonDown you should set AttachOnHandledEvents=true.
This is needed because Button is handling MouseLeftButtonDown and when this property is true we will also mange to handle it.
As for the border it should work if the border have background (when there is no background then mouse events are not fired).

Kind regards,
Hristo
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Menu
Asked by
Todd Millett
Top achievements
Rank 1
Answers by
Todd Millett
Top achievements
Rank 1
Kaloyan
Telerik team
Doug
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or