Windows Store app, Listview Groupheaderplacement Left and vertical scrolling

谁都会走 提交于 2019-12-12 04:13:10

问题


So I'm having a issue with GroupHeaderPlacement and Vertical scrolling. What Im trying to achieve is this:

But for some reason my groups are getting arranged in a horisontal scrolling direction. Anyone know if I'm missing something obvious here or if you simple can't have a vertical scrolling Listview if you have GroupHeaderPlacement Left.

The Code is:<ListView x:Name="ItemsGridView" Margin="118,-5,0,0" ItemsSource="{Binding Source={StaticResource AllCurrentGroup}}" SelectionMode="Single" Grid.Row="2" Grid.Column="0" ShowsScrollingPlaceholders="False" SelectionChanged="SelectedPresentationItem_SelectionChanged" IsSwipeEnabled="True"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid GroupHeaderPlacement="Left" Orientation="Vertical" /> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate> <StackPanel Grid.Column="1" Height="80" Margin="40,0,0,0" > <TextBlock Text="{Binding Tid }" Style="{StaticResource BodyTextBlockStyle}" Grid.Column="1" > <TextBlock.Foreground> <SolidColorBrush Color="{StaticResource Orange}"/> </TextBlock.Foreground> </TextBlock> <TextBlock Text="{Binding Titel }" Style="{StaticResource SubheaderTextBlockStyle}" Grid.Column="1" /> </StackPanel> </DataTemplate> </ListView.ItemTemplate> <ListView.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <StackPanel Grid.Column="0" Grid.RowSpan="{Binding Rows}" Width="160" Height="200"> <StackPanel.Background> <SolidColorBrush Color="{StaticResource BlueDark}"/> </StackPanel.Background> <TextBlock Text="{Binding Vecka, Converter={StaticResource ToWeekString }}" Style="{StaticResource BodyTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,13,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToDayNumber }}" Style="{StaticResource HeaderTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" Margin="20,26,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToMonth }}" Style="{StaticResource SubheaderTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,-3,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToDayString }}" Style="{StaticResource BodyTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,13,0,0"/> </StackPanel> </DataTemplate> </GroupStyle.HeaderTemplate> <GroupStyle.Panel> <ItemsPanelTemplate> <WrapGrid Orientation="Vertical"></WrapGrid> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </ListView.GroupStyle> </ListView>


回答1:


http://code.msdn.microsoft.com/windowsapps/GroupedGridView-77c59e8e/sourcecode?fileId=44751&pathId=298223712

Please refer the above sample link which helps you to achieve your req.



来源:https://stackoverflow.com/questions/23625849/windows-store-app-listview-groupheaderplacement-left-and-vertical-scrolling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!