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
Hello Ryan,
It seems that it was an old issue in version 15.1 and it should be fixed in the latest Service Release - 15.1.20151.2251. What I can suggest is to upgrade to the latest SR of 15.1 or higher version.
Let me know if you have any questions.
Sincerely,ZhivkoAssociate Software Developer
Hello Zhivko,
Thanks very much for your fast assistance. I tried this solution out and at first it didn't work. It will properly set the max height, but the scrollbar and mouse events will not work.
But it looks like it depends on what version of Infragistics I am using. Currently, I'm using Infragistics version 15.1, but when I switched to a trial of version 16.2, the scrollbar and mouse events work and the max height is properly set. Looks like the ScrollViewer.CanContentScroll property for MenuTool has some problem and was fixed in the newer version.
If there's no way around this in version 15.1, I suppose I will just wait to upgrade to the newer version.
Thanks again for your help.
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.