scrolling a wrapped menu

2 posts, 0 answers
  1. troy
    troy avatar
    20 posts
    Member since:
    Jun 2008

    Posted 25 Mar 2010 Link to this post

    I have a menu that contains many nested submenus.  As there are sometimes too many to display on the page, I created a style to implement the RadWrapPanel which correctly wraps the menus.  The problem is that if there are still too many it rolls off the screen.  I have tried to implement a ScrollViewer but with no success.  I have created a test for you to view.
    Here is the XAML:

    <Style x:Name="wrapStyle" x:Key="ItemStyle" TargetType="telerikNavigation:RadMenuItem">
    <!--set different MaxHeight to control the size of the menu-->
    <tk:RadWrapPanel Orientation="Vertical" MaxHeight="600"/>
    <ScrollViewer HorizontalScrollBarVisibility="Visible">
    <Grid x:Name="LayoutRoot" Background="White">
    <Border Grid.Row="1" Margin="20">
    <telerikNavigation:RadMenuName="menuFeat" Visibility="Visible" ClickToOpen="True">
    <telerikNavigation:RadMenuItem Name="menuItemRoot" Style="{StaticResourceItemStyle}" Header="AddFeature(s)"  StaysOpenOnClick="True"/>

    And here is the code behind which populates the menu:

    for(int i=0;i<1000;i++)
    RadMenuItem mi=new RadMenuItem();
    mi.Header=string.Format("SubMenu {0}",i);
    for(int j=0;j<10;j++)
    RadMenuItem mileaf=new RadMenuItem();
    mileaf.Header=string.Format("LeafMenu {0}",j);

    Any help would be greatly appreciated!


  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 30 Mar 2010 Link to this post

    Hi troy,

    Thank you for contacting us.

    You can find information how to put a ScrollViewer around the MenuItems in this blog post.
    Hope this helps.

    If you have further questions please feel free to contact us again.

    Best wishes,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top