Telerik Forums
UI for Silverlight Forum
0 answers
54 views
When user right click on a radmenuitem (silverlight), a context menu is displayed , including hide/Autohide/Dock ... . My Q:User do hide for a tab and the tab is hidden. Then user want to unhide the hidden tab but he/she dont know how to unhide the hidden tab !. Waht is the solution?
M
Top achievements
Rank 1
 asked on 12 Oct 2019
7 answers
106 views

Hello,
Recently we noticed that our product was not up for garbage collection when a user logged out, instead the entire product instance was held in memory. We've isolated it to what seems to be the RadMenu. Specifically the RadMenuItem when used as a SubMenuItem. This appears to happen either with RadMenuItems built in XAML, code behind, or binding to a collection with a template.

I have sample project to reproduce the issue but I couldn't attach it here. This occurs with the newest version 2016.1.112 and previous 2015.3.1104, I’m not sure of other releases.

 Attached is a PDF of the Instance Retention Graph from a popular memory profiler.

We have used RadMenus extensively throughout the product and were able to mitigate the issue with manual recursive cleanup by traversing the visual tree to decouple the RadMenuItems, by clearing all RadMenuItems of subitems and then all RadMenu's of all RadMenuItems. This has allowed the vast majority of the product to be collected with the exception of the RadMenuItems items themselves, which appear to be held onto by a ResourceDictionary.

We haven’t noticed this type of behavior with any other control, either Telerik or ours. Is this supposed to be doing this or are we supposed to do something else to release the memory?

If you need any additional info, please don’t hesitate to ask. Thank you,

 Patrick

 

Kalin
Telerik team
 answered on 26 Apr 2018
2 answers
67 views

Hi,

I had dynamically set DropDownHeight of RadMenuItem, till now it was working. After that I set the template style for telerikNav:RadMenuItem . But now DropDownHeight functionality has stopped working . Attached(style.txt) is the style code for telerikNav:RadMenuItem. Further attached is the top and bottom arrow of menu that are not showing now due to the template implementation. 

view.xaml

 <radNav:RadMenu x:Name="mnuMain"
                        Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"
                        Height="27"
                        Style="{StaticResource MainTopMenu}"  />

 <Rectangle x:Name="rctMenuSeparator" 
                   Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"
                   Height="2"
                   Style="{StaticResource MainTopMenuSeparator}" />

 

 

///view.xaml.cs code for setting dropdown

if (menuItem.ParentID == 0 && menuItem.MenuItemType == MenuItemType.ParentNode)
                        {
                            int subMenuChildCount = menuItems.Count(a => a.ParentID == menuItem.MenuItemID);
                            if (subMenuChildCount > 15)
                                menuControl.DropDownHeight = 405; 
                        }

 

// Style.xaml

<Style x:Key="MainTopMenu" TargetType="telerikNav:RadMenu">
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="ClickToOpen" Value="False" />
        <Setter Property="Background" Value="{StaticResource MainMenuBackground}" />
        <Setter Property="Foreground" Value="#FFFFFF" />
        <Setter Property="BorderBrush" Value="{StaticResource MainMenuBackground}" />
    </Style>
 <Style x:Key="MainTopMenuSeparator" TargetType="Rectangle">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Fill" Value="#FFC2CFE2" />
    </Style>
 
<Style x:Key="RadMenuItemStyle" TargetType="telerikNav:RadMenuItem">
        <Setter Property="TopLevelHeaderTemplateKey" Value="{StaticResource TopLevelHeaderTemplate}" />
    </Style>
    <Style TargetType="telerikNav:RadMenuItem" BasedOn="{StaticResource RadMenuItemStyle}" />

<ControlTemplate TargetType="telerikNav:RadMenuItem" x:Key="SeparatorTemplate">
        <Grid HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0" HorizontalAlignment="Left" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Menu.IconColumnWidth}" />
            <Grid Grid.Column="1" Height="2" Margin="{StaticResource MenuItemSeparatorMargin}">
                <Rectangle Height="1" VerticalAlignment="Top" Fill="{StaticResource MenuItemSeparatorTop}" />
                <Rectangle Height="1" VerticalAlignment="Bottom" Fill="{StaticResource MenuItemSeparatorBottom}" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="TopLevelHeaderTemplate" TargetType="telerikNav:RadMenuItem">
        <Grid x:Name="RootElement" Margin="{StaticResource MenuTopLevelItemMargin}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">

                    <VisualState x:Name="Highlighted">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="#FF009FE3"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ColorAnimation From="Black" To="Black" Storyboard.TargetName="Content" Storyboard.TargetProperty="(TextBlock.Foreground).(Brush.Color)"/>
                        </Storyboard>
                    </VisualState>


                    <VisualState x:Name="Normal" />
                </VisualStateGroup>

            </VisualStateManager.VisualStateGroups>
            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />


            <Grid x:Name="ContentGrid" Background="Transparent" Margin="{TemplateBinding Padding}" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Path x:Name="Tick" Margin="0 0 4 0" Grid.Column="0" Visibility="Collapsed" FlowDirection="LeftToRight" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z" />
                <ContentPresenter x:Name="Icon" Margin="0 0 4 0" Grid.Column="0" Content="{TemplateBinding Icon}" ContentTemplate="{TemplateBinding IconTemplate}" />
                <TextBlock x:Name="Content" Grid.Column="1" Text="{TemplateBinding Header}"/>
            </Grid>
            <Popup x:Name="PART_Popup" HorizontalOffset="-1" VerticalOffset="1">
                <Grid >
                    <Grid x:Name="PopupContentElement" Margin="0 0 3 3">
                        <telerikChromes:ShadowChrome />
                        <Border BorderThickness="1" BorderBrush="{StaticResource MenuPopupOuterBorder}" Background="{StaticResource MenuPopupBackground}">
                            <Grid>
                                <Grid Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Menu.IconColumnWidth}" HorizontalAlignment="Left">
                                    <Rectangle Fill="{StaticResource MenuPopupIconsBackground}" Margin="0 0 2 0" />
                                    <Grid HorizontalAlignment="Right" Margin="{StaticResource MenuPopupIconsSeparatorMargin}">
                                        <Rectangle Width="1" HorizontalAlignment="Right" Margin="0 0 1 0" Fill="{StaticResource MenuPopupIconsSeparatorLeft}" />
                                        <Rectangle Width="1" HorizontalAlignment="Right" Margin="0 0 0 0" Fill="{StaticResource MenuPopupIconsSeparatorRight}" />
                                    </Grid>
                                </Grid>
                                <ScrollViewer  MaxHeight="300" BorderThickness="0" Padding="0" VerticalScrollBarVisibility="Hidden">
                                    <ItemsPresenter Margin="1"/>
                                </ScrollViewer>
                            </Grid>
                        </Border>
                    </Grid>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>

 

Regards,

Anmol

Dilyan Traykov
Telerik team
 answered on 20 Feb 2018
2 answers
56 views
I have a RadMenu made by this example. I sometimes get an error from the menu, but I dont know what causes it.

Stack trace:
vid Telerik.Windows.Controls.RadMenuItem.OpenMenu()     vid Telerik.Windows.Controls.RadMenuItem.OnOpenTimerTick(Object sender, EventArgs e)     vid MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)     vid MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

I´m getting the same error as from this post: http://www.telerik.com/community/forums/silverlight/menu/radcontextmenu-crashes.aspx
But theres no solution.

The menu I uses is bounded to a MenuViewModel that inherits from ObservableCollection<MenuViewModel> (like the example link I posted previously). The menu is build up with a lot of diffrent styles to handle the diffrent properties in the menu items. 

<navigation:Page.Resources>       
        <Styles:MenuItemStyleSelector
            x:Key="MenuItemStyleSelector"
            TopLevel="{StaticResource MenuItemTopLevelStyle}" 
            Title="{StaticResource MenuItemTitleStyle}"
            Link="{StaticResource MenuItemLinkStyle}"                                     
            ParagraphImage="{StaticResource ParagraphImageMenuItemStyle}"
            TopLevelSection="{StaticResource MenuItemTopLevelSectionStyle}"/>
 
        <telerik:HierarchicalDataTemplate x:Key="MenuItemTemplate" ItemsSource="{Binding }">
             
            <telerik:ContainerBinding.ContainerBindings>
                <telerik:ContainerBindingCollection>
                    <telerik:ContainerBinding PropertyName="Header" Binding="{Binding Content}" />
                    <telerik:ContainerBinding PropertyName="IsSeparator" Binding="{Binding IsSeparator}" />
                </telerik:ContainerBindingCollection>
            </telerik:ContainerBinding.ContainerBindings>
 
            <HyperlinkButton Content="{Binding Path=Content}" NavigateUri="{Binding Path=Url}" />
        </telerik:HierarchicalDataTemplate>
    </navigation:Page.Resources>
     
    <StackPanel>
        <telerik:RadMenu
            Style="{StaticResource MenuStyle}"
            ItemsSource="{Binding MenuItems}"
            ItemTemplate="{StaticResource MenuItemTemplate}"
            ItemContainerStyleSelector="{StaticResource MenuItemStyleSelector}" />       
    </StackPanel>



Does anyone know the soulution of the problem or what could be causing this issue?

I´m using telerik RadControls for Silverligt v 12.1.326.0, Silverlight 5 and C#.

Thx!
Anmol
Top achievements
Rank 1
 answered on 06 May 2016
4 answers
104 views
Hi I am using RadMenu 2010.1.309.1030. When I hover the mouse over the menu item and leave it there, the submenu opens and closes by itself without the mouse being moved. We are using SL3 and have no plans to upgrade until the memory leak issues are fixed. Is this a bug? Is there any way around this?
Abhishek
Top achievements
Rank 1
 answered on 09 Nov 2015
2 answers
35 views

Hello,

  We have a richtextbox control and a context menu builder. When 

1. Add a table in the middle /or on bottom/ of the screen view
2. Right mouse click in some table’s cell​

and the result is that the Font configuration tends to overlay the context menu 

 My question is how to make some kind of positioning that avoids overlapping

 

 Thanks!

Todor
Telerik team
 answered on 09 Sep 2015
5 answers
55 views
I'm using Silverlight Radmenu and am running into the folllowing problem:

I can't seem to set focus to or tab to the the radmenu control.  I've turned on IsTabStop for the UserControl, the menu, and the menuitems but I can't tab to the menu.  I can only seem to access it via the mouse.  Once I click on a menu with sub menus I can navigate the menu using the keyboard but only if I keep the mouse over the menu.  I've also had no luck trying to setfocus from code.

Is there any to do this via the keyboard or to set focus programatically so that users can use the key to navigate the menu.

Thanks, Mike
Nasko
Telerik team
 answered on 15 May 2015
1 answer
21 views
I have the following XAML-code:


<telerik:RadMenu Grid.Row="2"
                         Grid.Column="1"
                         Margin="-6,0,0,0"
                         VerticalAlignment="Center"
                         Background="Transparent"
                         ClickToOpen="True"
                         IconColumnWidth="0">
            <telerik:RadMenuItem x:Name="KontextRadMenuItem" StaysOpenOnClick="True">
                <telerik:RadMenuItem.Header>
                    <TextBlock Foreground="DarkBlue" Text="{Binding SelectedKontextText}" />
                </telerik:RadMenuItem.Header>
                <telerik:RadMenuGroupItem IsCheckable="True"
                                          ItemTemplate="{StaticResource MenuTemplate}"
                                          ItemsSource="{Binding KontextAuswahlList}"
                                          ScrollViewer.VerticalScrollBarVisibility="Auto"
                                          MaxHeight="300"
                                          Padding="-5,-5,-5,-5"
                                          StaysOpenOnClick="True"
                                          cal:Message.Attach="[Event Checked] = [Action KontextHinzufuegen($source,$eventArgs)]; [Event Unchecked] = [Action KontextEntfernen($source,$eventArgs)];[Event KeyDown] = [Action KontextAuswahlKeyDown($source,$eventArgs)]" />
                
            </telerik:RadMenuItem>
        </telerik:RadMenu>

My menu has around 300 menu items. How do I let the user type some chars, e.g. just the letter P, to jump to the first occurance starting with a P? Is there SearchPath, which i can set to SelectedContextText? Or something similar?
Kalin
Telerik team
 answered on 23 Mar 2015
1 answer
39 views
Hi,

I have a menu with vertical orientation.  The menu has a width that is wider than the longest menu item.  However, the menu items' width gets set to the longest menu item.  Is there a way I can stretch the menu items to the full width of the menu control?

I have created a custom style/template for MenuItem, however after setting HorizontalAlignment="Stretch" on all controls, the menu items width is still auto-set to the longest item.

Thanks,
Justin
Dimitrina
Telerik team
 answered on 25 Dec 2014
3 answers
50 views
Hello guys.

I want to build rad menu like the next image shows.

its, possible that?

Do you have one sample code?


Regards..
Masha
Telerik team
 answered on 29 Oct 2014
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?