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

scrollable wrapped menu

1 Answer 56 Views
Menu
This is a migrated thread and some comments may be shown as answers.
troy
Top achievements
Rank 1
troy asked on 28 Jul 2010, 04:46 PM
I have a menu that has hundreds of submenus and I want to use the RadWrapPanel to display these submenus.  This works fine by create a style to override the ItemsPanelTemplate.  My problem is when the number of items exceeds my max width, I need a scroll bar.  I tried to accomplish this using the style below.  This is problematic b/c it appears to be applying the ScrollViewer to each menuitem and not to the ItemsPanel...  I have tried to figure out how to get to the ControlTemplate of the ItemsPanel but to no avail.  I also edited the style in Blend but  I  can't find anything for the ItemsPanel.

Any help would be greatly appreciated.

Troy

BTW - I am using the Q2 2010 version of the controls.

 

<Style TargetType="telerikNavigation:RadMenuItem">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<!-- set different MaxHeight to control the size of the menu -->
<telerik:RadWrapPanel Orientation="Vertical" MaxHeight="800" MaxWidth="800" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter><Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ScrollViewer>
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style

 

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 02 Aug 2010, 03:59 PM
Hello Troy,

Displaying hundreds of menu items is a terrible user experience. I don't know what is your application logic and how it demands this large menu but in general it would be better to create a custom dialog window that displays the items in ListBox or RadComboBox (note that RadComboBox support filtering and virtualization).

Setting:
<ControlTemplate>
<ScrollViewer>
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
As control template is not enough. The menu items have more complex ControlTemplate. There are 4 templates for 4 different menu items. First level menu items with sub menu items, first level menu items without sub menu items, sub menu items that do not have further sub menu items and sub menu items with other sub menu items. I would recommend you to open the Input assembly with Reflector it will alow you to see all the resources in the assembly including the office theme for the menu (i think the resource should be something like themes/office/black/menu.xaml) You will see that the ControlTemplate has additional stuff like visual states, presenters for the header, icon, popup with the ItemsPresenter inside. you should put the ItemsPresenter in ScrollViewer like you did but you should also keep all the other stuff in place.

Kind regards,
Panayot
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
Tags
Menu
Asked by
troy
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or