Change GridView Header Layout

I have a regular GridView that displays grouped data. My goal is to move the title (button) from the top of the group to the left of the group.

<GridView>
    <GridView.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>
    </GridView.ItemsPanel>

    <GridView.GroupStyle>
        <GroupStyle>
            <GroupStyle.HeaderTemplate>
                <DataTemplate>
                    <Grid>
                        <Button Content="{Binding Title}"/>
                    </Grid>
                </DataTemplate>
            </GroupStyle.HeaderTemplate>
            <GroupStyle.Panel>
                <ItemsPanelTemplate>
                    <VariableSizedWrapGrid ItemWidth="240" ItemHeight="160" Orientation="Vertical" Margin="0,0,80,0"/>
                </ItemsPanelTemplate>
            </GroupStyle.Panel>
        </GroupStyle>
    </GridView.GroupStyle>

    <GridView.ItemTemplate>
        <!-- item template -->
    </GridView.ItemTemplate>
</GridView>

Answer to this question Grouping the GridView in a Windows 8 Metro application - although not completely the same layout you want - says that the desired layout is not possible without adding an additional “dummy tile”.

I am wondering if it is possible to achieve my goal - to move the title from the top of the group to the left of the group - without such an additional “dummy tile”.

+5
source share
1 answer

. Visual Studio GridView

Edit Group Style -> Edit Generated Item Container (Container Style) -> Edit a Copy

, , ItemsControl. , . , Grid.Column=0 Grid.Row=1, .

+2

All Articles