how can i sort the items of GridView horizontal in the XAML? Sadly i found no method to achieve this. The Keyword "Orientation" is not available. Here is my current GridView:
<GridView x:Name="TestDataBinding"
HorizontalContentAlignment="Left"
VerticalContentAlignment="Top"
SelectionMode="None"
ItemsSource="{Binding}"
ItemTemplateSelector="{StaticResource itemTemplateSelector}"
Margin="0,60,0,0"
Width="1100" Height="540"
/>
Another Way could be a "VariableSizedWrapGrid". But this can't be used for creating Items through "ItemsSource" (and ItemTemplateSelector).
Sorry, I have to take issue with your comment that this cannot be done with a VariableSizedWrapGrid. It most certainly can:
<GridView>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VariableSizedWrapGrid Orientation="Horizontal" />
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<x:String>One</x:String>
<x:String>Two</x:String>
<x:String>Three</x:String>
<x:String>Four</x:String>
</GridView>
And I have to take issue that VariableSizedWrapGrid cannot be used for creating items through ItemsSource. It most certainly can. WrapGrid and VariableSizedWrapGrid are fundamentally identical. WrapGrid is slightly lighter weight since it does not support Column and Row spanning.
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