Content menu does not pop up where it should

2 posts, 0 answers
  1. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 05 Nov 2012 Link to this post

    Hi,

    I have following menu:
    <ControlTemplate x:Key="MenuItemSpecialLinkControlTemplate" TargetType="telerik:RadContextMenu">
                <StackPanel HorizontalAlignment="Center" Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <features:RadGeometryButton
                            Command="{Binding CopyCommand}"
                            Style="{StaticResource RadButtonStyle}" Content="{localization:TranslationExtension ResourceType=ExqiPresenter.Localization.Strings.ExqiSlidedeck.StringsSlidedeckView,Key=SettingsPaneCopy}"
                            Geometry="M9.91,5.25 L9.91,10.00 L5.21,10.00 L5.21,17.60 L14.62,17.60 L14.62,5.25 z M0.50,0.50 L1.44,0.50 L2.38,0.50 L11.79,0.50 L12.74,0.50 L13.68,0.50 L13.68,3.35 L11.79,3.35 L11.79,2.40 L2.38,2.40 L2.38,14.75 L3.32,14.75 L3.32,10.00 L9.91,3.35 L14.62,3.35 L16.50,3.35 L16.50,5.25 L16.50,17.60 L16.50,19.50 L14.62,19.50 L5.21,19.50 L3.32,19.50 L3.32,17.60 L3.32,16.65 L2.38,16.65 L0.50,16.65 L0.50,14.75 z"  />
                        <features:RadGeometryButton
                            Command="{Binding PasteCommand}"
                            Style="{StaticResource RadButtonStyle}" Content="{localization:TranslationExtension ResourceType=ExqiPresenter.Localization.Strings.ExqiSlidedeck.StringsSlidedeckView,Key=SettingsPanePaste}"
                            Geometry="M2.38,4.30 L2.38,15.70 L4.25,15.70 L4.25,11.90 L9.88,6.20 L9.88,11.90 L6.13,11.90 L6.13,17.60 L13.63,17.60 L13.63,8.10 L9.88,8.10 L9.88,6.20 L11.75,6.20 L11.75,4.30 L8.00,4.30 L6.13,4.30 z M6.30,0.50 L7.87,0.50 C9.23,0.72 9.88,1.35 9.88,2.40 L11.75,2.40 L12.69,2.40 L13.63,2.40 L13.63,6.20 L15.50,6.20 L15.50,7.15 L15.50,8.10 L15.50,19.50 L13.63,19.50 L6.13,19.50 L4.25,19.50 L4.25,17.60 L0.50,17.60 L0.50,16.65 L0.50,15.70 L0.50,4.30 L0.50,2.40 L2.38,2.40 L4.25,2.40 C4.25,1.35 5.33,0.68 6.30,0.50 z" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <features:RadGeometryButton Command="telerik:DiagramCommands.Cut"
                            Style="{StaticResource RadButtonStyle}" Content="{localization:TranslationExtension ResourceType=ExqiPresenter.Localization.Strings.ExqiSlidedeck.StringsSlidedeckView,Key=SettingsPaneCut}"
                            Geometry="M12.5,14.928352 C11.671574,14.928352 11.000001,15.599925 11.000001,16.428352 C11.000001,17.256779 11.671574,17.928352 12.5,17.928352 C13.328428,17.928352 14,17.256779 14,16.428352 C14,15.599925 13.328428,14.928352 12.5,14.928352 z M3.4999995,14.928352 C2.6715724,14.928352 1.9999996,15.599925 1.9999995,16.428352 C1.9999996,17.256779 2.6715724,17.928352 3.4999995,17.928352 C4.3284268,17.928352 4.9999995,17.256779 4.9999995,16.428352 C4.9999995,15.599925 4.3284268,14.928352 3.4999995,14.928352 z M11.690025,0 L13.422111,0.99997997 L9.1120167,8.464983 L11.737597,13.012623 L11.794629,12.99946 C12.02247,12.952837 12.258376,12.928352 12.500001,12.928352 C14.432998,12.928352 16,14.495356 16,16.428352 C16,18.361349 14.432998,19.928352 12.500001,19.928352 C10.567004,19.928352 9.000001,18.361349 9.000001,16.428352 C9.000001,15.522261 9.3443136,14.696587 9.9092369,14.075031 L9.9916067,13.988637 L7.9572473,10.465023 L5.9543843,13.933944 L5.974874,13.953479 C6.6082492,14.586854 7,15.461854 7,16.428352 C7,18.361349 5.4329967,19.928352 3.5,19.928352 C1.5670034,19.928352 -5.1723987E-08,18.361349 0,16.428352 C-5.1723987E-08,14.495356 1.5670034,12.928352 3.5,12.928352 C3.6812184,12.928352 3.8592203,12.942125 4.0330153,12.96868 L4.1864357,12.996078 L6.8025465,8.465023 L2.4927113,1.0001688 L4.2248311,0.00012874603 L7.9573164,6.464983 z" />
                        <features:RadGeometryButton Command="telerik:DiagramCommands.Delete"
                            Style="{StaticResource RadButtonStyle}" Content="{localization:TranslationExtension ResourceType=ExqiPresenter.Localization.Strings.ExqiSlidedeck.StringsSlidedeckView,Key=SettingsPaneDelete}"
                            Geometry="M2.39,6.20 L4.28,6.20 L4.28,17.60 L6.17,17.60 L6.17,6.20 L8.06,6.20 L8.06,17.60 L9.94,17.60 L9.94,6.20 L11.83,6.20 L11.83,17.60 L13.72,17.60 L13.72,6.20 L15.61,6.20 L15.61,19.50 L2.39,19.50 z M4.28,0.50 L13.72,0.50 L13.72,2.40 L17.50,2.40 L17.50,4.30 L0.50,4.30 L0.50,2.40 L4.28,2.40 z" />                   
                    </StackPanel>
                </StackPanel>
            </ControlTemplate>
     
            <Style x:Key="MenuItemSpecialLinkControlStyle" TargetType="telerik:RadContextMenu">
                <Setter Property="Template" Value="{StaticResource MenuItemSpecialLinkControlTemplate}" />                   
                <Setter Property="Height" Value="400" />
                <Setter Property="Width" Value="140" />           
            </Style>

    This menu is linked to the diagram as follows:
    <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" x:Name="DiagramScroller">               
                <telerik:RadDiagram x:Name="diagram" 
                        HorizontalAlignment="Stretch"
                                    BorderBrush="Green" BorderThickness="1"
                                    Margin="5,0,0,0"
                        telerik:DiagramSurface.IsVirtualizing="True"                   
                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"                               
                        ScrollViewer.VerticalScrollBarVisibility="Disabled"                               
                        AllowPaste="False"                 
                        Background="{Binding Path=MaximizedSlide.BackGround, Converter={StaticResource brushToColor}}"                               
                        IsConnectorsManipulationEnabled ="false"
                        IsRotationEnabled="False"                                                                                 
                        IsBackgroundSurfaceVisible="False"                               
                        IsPanEnabled="False"
                        IsZoomEnabled="False"
                                      >
                    <telerik:RadContextMenu.ContextMenu>
                        <telerik:RadContextMenu x:Name="GridContextMenu"
                                                Style="{StaticResource MenuItemSpecialLinkControlStyle}" />
                     </telerik:RadContextMenu.ContextMenu>
                  </telerik:RadDiagram>
                </ScrollViewer>

    The menu works, but when i put the mouse in lower part of the diagram, the popup menu is displayed very high on the diagram. If i click on the diagram on the upper part, the menu is displayed next to the mouse pointer as it should be. I know the component tries to make sure the menu does not fall off the screen, but the spacing is way too much. I don't see a reason for this behavior.

    Best Regards,

    Peter

  2. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 06 Nov 2012 Link to this post

    Figured it out, 400 pixels height was way too much, that caused the issue... my bad.
Back to Top