RadContextMenu positioning bug

7 posts, 1 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 20 Oct 2008 Link to this post

    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
  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 23 Oct 2008 Link to this post

    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.
  3. DevCraft banner
  4. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 23 Oct 2008 Link to this post

    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?
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 24 Oct 2008 Link to this post

    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.
  6. D. Omar
    D. Omar avatar
    29 posts
    Member since:
    Mar 2009

    Posted 26 May 2009 Link to this post

    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.
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 27 May 2009 Link to this post

    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.
  8. D. Omar
    D. Omar avatar
    29 posts
    Member since:
    Mar 2009

    Posted 29 May 2009 Link to this post

    Thank you!
Back to Top
DevCraft banner