locked
Alternative for GroupStyle.ContainerStyle to make group headers in list view stretch?

Answers

  • Hi,

    Please see the link:

    https://msdn.microsoft.com/en-us/library/windows/apps/dn263110.aspx

    GroupStyle class

    Three properties of the GroupStyle class for ListView and GridView are deprecated and ignored. The properties Panel, ContainerStyle, and ContainerStyleSelector of GroupStyle are no longer honored when ItemsPanel is an ItemsStackPanel. ListView and GridView will be laid out like a traditional list—from top to bottom. Thus, the layout or appearance of items within a group could change in a Windows 8 app that is recompiled for Windows 8.1 if the app does not explicitly set ItemsPanel but set Panel, ContainerStyle, and ContainerStyleSelector. An app that has taken a dependency on the internal structure and types of default ListView objects can crash because the type of ItemsPanel will change and GroupItems will not be created when GroupStyle.Panel is an ItemsStackPanel. This crash would most likely occur when walking the visual tree.

    Avoid this by setting ItemsPanel back to the Windows 8 panel (VirtualizingStackPanel) or removing assumptions about the visual tree structure.

    So if you change the ListView ItemsPanel to VirtualizingStackPanel, the GroupStyle.ContainerStyle can used for ListView in windows 8.1:

    <ListView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel></VirtualizingStackPanel>
                    </ItemsPanelTemplate>
                </ListView.ItemsPanel>
                
    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    • Marked as answer by Kirstiin Tuesday, February 17, 2015 8:21 AM
    Thursday, February 12, 2015 9:37 AM