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

Problem with RadialContextMenu Positioning

1 Answer 152 Views
RadialMenu
This is a migrated thread and some comments may be shown as answers.
Eugenio
Top achievements
Rank 1
Eugenio asked on 16 Feb 2015, 10:39 AM
Hi,
  I've got a problem with the new RadialMenu. I'm trying to using it into a Grid object and open it with the option PopupPlacement="MousePoint".
   <Grid x:Name="myGrid">
        <telerik:RadRadialMenu.RadialContextMenu>
            <telerik:RadRadialMenu PopupPlacement="MousePoint" IsOpen="True" StaysOpenOnShow="True">
                <telerik:RadRadialMenuItem>
                    <telerik:RadRadialMenuItem Header="Refresh" CommandParameter="REFRESH" />
                    <telerik:RadRadialMenuItem Header="Search" CommandParameter="SEARCH" ContentSectorBackground="LightBlue" />
                </telerik:RadRadialMenuItem>
            </telerik:RadRadialMenu>
        </telerik:RadRadialMenu.RadialContextMenu>
        <Image Source="landscape.jpg" />
    </Grid>
I've used the same algorithm used in the Demo for showing / hiding the ContextMenu:

private void OnEditorMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
                var radialMenu = RadRadialMenu.GetRadialContextMenu(this.Editor);
                var mousePoint = e.GetPosition(this.Editor as IInputElement);
                radialMenu.PopupHorizontalOffset = mousePoint.X;
                radialMenu.PopupVerticalOffset = mousePoint.Y;
                RadialMenuCommands.Show.Execute(null, this.Editor);
            }
        }

private void OnEditorMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
                RadialMenuCommands.Hide.Execute(null, sender as IInputElement);
            }
        }
For the first click everything is working fine and the RadialContextMenu is shown exactly centered with the Mouse Pointer but... after the second click the RadialContextMenu popup as it was PopupPlacement="Mouse".

Is it a bug ?


Thanks for the help



1 Answer, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 17 Feb 2015, 09:59 AM
Hello Eugenio,

Indeed there was an issue with the PopupPlacement Mouse, that is already resolved. You can test the same scenario with the latest internal build where the fix is available. However if you use the approach from the example with the RichTextBox, you would need to use PopupPlacement="Relative" as in the example. For a simpler solution you can also use the ShowEventName and HideEventName properties as explained here.

Hope this helps.

Regards,
Kalin
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
Eugenio
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or