I use GridView to display groups of different sets of elements in a WinRT XAML application. Everything works well, except that the ItemsPanelTemplate uses a wrapping grid that removes my elements vertically when it leaves space.
So, I tried using a StackPanel, for example:
<GroupStyle.Panel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" Visibility="Visible" /> </ItemsPanelTemplate> </GroupStyle.Panel>
Elements are arranged vertically, which is great, but the problem is that I cannot scroll them, and they do not fit on the screen. So I tried to enable vertical scrolling:
<GroupStyle.Panel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" Visibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollMode="Enabled"/> </ItemsPanelTemplate> </GroupStyle.Panel>
But that does not work. Any suggestions on how to do vertical scrolling inside a GridView group?
EDIT 1:
I also tried this:
<GroupStyle.Panel> <ItemsPanelTemplate> <ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollMode="Disabled" ZoomMode="Disabled" VerticalScrollMode="Enabled"> <StackPanel Orientation="Vertical" Visibility="Visible" /> </ScrollViewer> </ItemsPanelTemplate> </GroupStyle.Panel>
This breaks off the debugger, because the ItemsPanelTemplate needs a panel as a child.
Igor Ralic
source share