I have a Grid inside a ListView. If I place the Grid outside of the ListView, it correctly stretches to fill the screen. If I place it within the ListView, it does not. Here's my code
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<ListView HorizontalContentAlignment="Stretch">
<ListViewItem>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="60"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0">Title</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="1">Text</TextBlock>
<Button Grid.Column="1">Pin</Button>
</Grid>
</ListViewItem>
</ListView>
</Grid>
How do I get the Grid it to stretch and fill the ListView?
You probaby need to set the HorizontalContentAlignment of the ListViewItem to Stretch.
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