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

RadContextMenu positioning bug

6 Answers 243 Views
Menu
This is a migrated thread and some comments may be shown as answers.
hwsoderlund
Top achievements
Rank 1
hwsoderlund asked on 20 Oct 2008, 11:41 AM
I've put the context menu inside a data grid cell, and sometimes it is positioned incorrectly in the top left corner of the usercontrol containing the datagrid. I've uploaded a sample project demonstrating the behaviour. It is the blue rectangles in the datagrid that open the menu. You might have to try several times before the problem occurs.

http://cid-cc43a90a79374ebd.skydrive.live.com/self.aspx/Public/SilverlightApplication13.zip

6 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 23 Oct 2008, 09:35 AM
Hello Henrik,

Thanks for the sample project!

The  problem with the ContextMenu is that it relies on MouseEvents to get the last position of the mouse. Unfortunately they do not always work as expected.

A quick workaround will be to change the Placement of the context menu like so:

<teleriknav:RadContextMenu EventName="MouseLeftButtonUp" Placement="Bottom"

This way the content menu will depend on the position of its parent element, which we can figure out.

The positioning problem is a bug, we will try to address it for Q3.

Kind regards,
Miroslav
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
hwsoderlund
Top achievements
Rank 1
answered on 23 Oct 2008, 11:45 AM
Placement="Bottom" works fine, I'll go with that. There is one small thing I noticed, though: When the "opener" element is positioned at the far right of the browser window the context menu doesn't adjust its position correctly. Ideally it should move to the left just enough to make the entire menu visible. The funny thing is that it adjusts itself correctly if I click the "opener" element a second time while the menu is still visible. Is this a problem you're aware of, or would you like me to post some screenshots?
0
Miroslav
Telerik team
answered on 24 Oct 2008, 02:25 PM
Hello Henrik,

I am happy that the Placement property works for you.

It seems we have one more thing to fix in the context menu :).

Thanks once again for the great feedback!

Kind regards,
Miroslav
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
D. Omar
Top achievements
Rank 1
answered on 26 May 2009, 03:29 PM
I have version 2009.1.423.1020 and looks like the positioning bug is still there but I am not sure if this is the same bug. Considering the following XAML:

<

 

UserControl xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" x:Class="ContextMenuTest.Page"  

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

Width="400" Height="300">

 

<Grid x:Name="LayoutRoot" Background="White">

 

 

<Rectangle x:Name="_rect" Fill="LightGray" Width="388" Height="307" HorizontalAlignment="Center"  

 

                    VerticalAlignment="Center">

     

<telerikNavigation:RadContextMenu.ContextMenu>

 

         

<telerikNavigation:RadContextMenu x:Name="_contextMenu1" EventName="MouseLeftButtonDown">  

 

            <telerikNavigation:RadMenuItem Header="Option1" x:Name="Option1" Click="ContextMenuItem_Click" />  

 

            <telerikNavigation:RadMenuItem Header="Option2" x:Name="Option2" Click="ContextMenuItem_Click" />

 

         </telerikNavigation:RadContextMenu>

 

    </telerikNavigation:RadContextMenu.ContextMenu>

 

</Rectangle>

 

 

</Grid>  

</

 

UserControl>

 

 

 

 

 


If you click in the rectangle the menu will pop-up fine, but if without taking any action in the menu, you move the mouse and go click somewhere else the menu just disappears without appearing in the new mouse position. Then if *without moving the mouse pointer* click again on the same location the menu will pop-up again, but at the location where it was at the first time. In other words, if you make the context menu disappear by clicking somewhere else and then click again on the smae point, the menu will keep re-appearing ion its original location.
0
Valeri Hristov
Telerik team
answered on 27 May 2009, 08:28 AM
Hi D. Omar,

I fixed the positioning bug you reported. The fix will be available in the upcoming internal build this friday.

All the best,
Valeri Hristov
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
D. Omar
Top achievements
Rank 1
answered on 29 May 2009, 06:59 PM
Thank you!
Tags
Menu
Asked by
hwsoderlund
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
hwsoderlund
Top achievements
Rank 1
D. Omar
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or