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

Radial Menu as a ContextMenu position

1 Answer 266 Views
RadialMenu
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 05 Nov 2014, 09:04 PM
Hi,

I would like to have a radial context menu appear next to my cursor, or centered on it, when I right click inside a RadMap.

Something like this:

        <telerik:RadMap>
            <telerik:RadRadialMenu.RadialContextMenu >
                <telerik:RadRadialMenu ShowEventName="MouseRightButtonDown" HideEventName="LostFocus"  >
                    <telerik:RadRadialMenuItem Header="Item 1" />
                    <telerik:RadRadialMenuItem Header="Item 2" />
                    <telerik:RadRadialMenuItem Header="Item 3" />
                </telerik:RadRadialMenu>
            </telerik:RadRadialMenu.RadialContextMenu>
        </telerik:RadMap>

The problem is that the Radial Menu does not appear next to the point where I clicked. It actually appears outside my window!
How do I control a contextual Radial Menu's position?

Sebastien

         

1 Answer, 1 is accepted

Sort by
0
Accepted
Vladi
Telerik team
answered on 06 Nov 2014, 02:20 PM
Hi Sebastien,

Thank you for contacting us.

When the RadRadialMenu is used as RadialContextMenu its placement is determined by the placement of the Popup in which it is placed. As any Popup in the WPF framework its Placement could be set to Right, Left, Bottom, Mouse, Absolute etc. Setting that placement is done via the PopupPlacement of the RadRadialMenu control. When the PopupPlacement is set to Mouse/MousePoint it is rendered immediately underneath the mouse cursor. In such scenarios if it is desired that the menu's center button is offset in order to make it appear not exactly underneath the cursor we have provided two properties of type double which could be used. To offset the placement in horizontal and vertical direction all you need to is set the PopupHorizontalOffset and PopupVerticalOffset properties of the menu.

I created and attached a sample project to my response of the described approach. Hope this is helpful. You can also take a loot at our XAML SDK repository at GitHub which includes runnable projects of many useful scenarios for all Telerik UI for WPF and Silverlight. You can also check the SDK Samples Browser that provides a more convenient approach in exploring and executing those examples. The SDK Samples Browser application is available for download from this link.

Regards,
Vladi
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
RadialMenu
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or