Windows 8 GridView Max Items (Based on Screen Size)
I am creating an app for Windows 8 (not 8.1).
I would like to show some content on the screen just like in the Windows Store app.
I am currently using a GridView, but another control can be used if needed.
I need the following:
On a small screen, the Windows store only shows 6 items in a category as follows:
Whereas on a larger screen, it displays 9 items like this:
I would like to add a similar implementation, but I donβt know how.
Do I only need to set 6 items as the source for the GridView when the screen is small and 9 when the screen is large? Or can the GridView automatically display only as many items that can be seen in three columns and "n" rows?
Here is some sample code for my GridView - I am using WrapGrid to limit the number of columns to 3
<Grid Name="MyGrid">
<GridView Name="MyGridView">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="3" />
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<GridView.ItemTemplate>
<DataTemplate>
<Grid>
<Image Source="{Binding Icon}" Margin="10" Stretch="Uniform" Width="150" Height="150" />
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
source to share