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

RadContextMenu positioning when when used with RightClick

4 Answers 269 Views
Menu
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 06 Nov 2008, 04:22 PM
We've just started using RADControls for Silverlight nad have replaced our previous home grown menu with the RADContextMenu to handle RightClick context sensitive menu. Our  only problem is placment we need to know the size of the rendered control in order to set the intial position of the control so the bottom right corner is located where the mouse click occured. The right click is trapped by overlaying the SilverLight control with a transparent DIV and then generating a fake RightClickEvent from JavaScript for SilverLight to handle, this opens and posistions a Popup containing the RADContextMenu.

Can we determine the rendered size at this point or is there a better way to load and position the control.


Thanks in advance for any advice


4 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 06 Nov 2008, 05:20 PM
Hi John,

RadContextMenu support Absolute, Bottom, Center, Right, Left and Top positioning through Placement property. The default value is Absolute and menu top left corner is positioned where the mouse is located.
RadContextMenu also support MouseRightButtonDown event (and this is the default event) but for this event to work you should run Silvelight 2 in windowless mode (keep in mind that this can significantly decrease you application performance).
You can set EventName property to any event that is thrown by the control the has ContextMenu (for example MouseLeftButtonDown, Click - for buttons, etc.). For more information you can check the help file.
The ContextMenu have Opened routed event so you can attach to it, get the RenderSize and move the ContextMenu using HorizontalOffset and VerticalOffset. This way you can achieve bottom right corner placement.

Hope this helps. If you have more question I'll be glad to help.


Regards,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Voss Grose
Top achievements
Rank 1
answered on 17 Jul 2009, 08:03 PM
Is there an event for Mouse Double Click?
0
Boyan
Telerik team
answered on 22 Jul 2009, 03:08 PM
Hi Voss Grose,

It is not supported by RadContextMenu.In fact there is no event  DoubleClick in Silverlight . You can not set EventName to be DoubleClick. You can create custom DoubleClick  by custom code as is shown in this thread. And then you can add handler to the event and try to attach RadContextmenu to it. It can work but such a scenario is not tested, so i can't guarantee this workaround will work properly. You can give it a try and hopefully it will work properly. If you need more help please let me know.

Best wishes,
Boyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
scvn80
Top achievements
Rank 1
answered on 22 Aug 2013, 03:52 AM
Sorry I post wrong thread.
Tags
Menu
Asked by
John
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Voss Grose
Top achievements
Rank 1
Boyan
Telerik team
scvn80
Top achievements
Rank 1
Share this question
or