I'm looking to layout a ListView in a Windows 8.1 app so that its elements wrap to (at most) two columns that read in order like a newspaper and scroll vertically, e.g.,
1 4
2 5
3
The closest I've gotten is:
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="2" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
but since MaximumRowsAndColumns is interpreted per the Orientation, the result is
1 2
3 4
5
switching the Orientation to Vertical gives me
1 2 3
4 5
Am I going to need a custom panel to do this? Another tactic is perhaps a gridview within a scrollviewer, but that seems a little hacky to me.
You should use ItemsWrapGrid :
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
This will give you the result that you want :
1 4
2 5
3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With