WPF ListView VerticalScrollBar not showing

I am showing a collection of items in a ListView. The collection is long enough to show the VerticalScrollBar in the ListView, but it does not 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 as follows:

 <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> 
+4
source share
1 answer

Found. Grid Row height changed from "Auto" to "*" .

 <!-- Row where the ListView is shown --> <RowDefinition Height="*" /> 
+8
source

Source: https://habr.com/ru/post/1484839/


All Articles