I'm displaying a collection of items on a ListView. The collection is long enough to show the VerticalScrollBar of the ListView but it doesn't work.
My XAML:
<UserControl>
<Grid>
<ListView ItemsSource="{Binding MyCollection}">
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn DisplayMemberBinding="{Binding MyProperty}" Header="MyProperty" />
...
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
</Grid>
</UserControl>
My UserControl is used like this:
<Window>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Menu Grid.Row="0" IsMainMenu="True">
<MenuItem Header="_File" />
...
</Menu>
<TabControl Grid.Row="1" >
<TabItem Header="myUserControl">
<views:MyUserControl />
</TabItem>
...
</TabControl>
...
</Grid>
</Window>
Found it.
The height of the Grid
Row
modified from "Auto"
to "*"
.
<!-- Row where the ListView is shown -->
<RowDefinition Height="*" />
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