Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
MenuTool - Specify dropdown maximum vertical size
posted

Hello,

I searched all over and tested multiple code ideas and am surprised I haven't found a way to do this yet...

It's really straightforward: I want to specify the size of the dropdown list of items inside a MenuTool. Currently, it stretches my entire screen until it hits the top and/or bottom. So if I had a MenuTool with a collection of 250 items, I want to specify a maximum height so the dropdown will only show at most ten items. Then, the scrollbar or arrows will appear and I can use that or the mouse wheel to navigate through.

Thanks much,

- Ryan

Parents
No Data
Reply
  • 16495
    Verified Answer
    Offline posted

    Hello Ryan,

    You can set the MenuTool's ItemsPanel to an ItemsPanelTemplate that contains a VirtualizingStackPanel, this way you can set the MaxHeight of VirtualizingStackPanel  to the value you wish and will be able to navigate with mouse wheel though the items, for example:

     <igRibbon:MenuTool MinWidth="70" Caption="Tools" 
                        ItemsSource="{Binding Items}"
                        ScrollViewer.CanContentScroll="True"
                        DisplayMemberPath="TotalCount">
         <igRibbon:MenuTool.ItemsPanel>
             <ItemsPanelTemplate>
                 <VirtualizingStackPanel   MaxHeight="100" />
             </ItemsPanelTemplate>
         </igRibbon:MenuTool.ItemsPanel>
     </igRibbon:MenuTool>

    Let me know if you need further asistance.

    Sincerely,
    Zhivko
    Associate Software Developer

Children