Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

ScrollViewer does not work if Grid is within a StackPanel

$
0
0

Hi

 

Does anyone know why the vertical ScrollViewer is inactive when a place the grid within a stackpanel. If I leave out the Stackpanel and place the Grid directly on the window, the scroll viewer works as expected.

Code Snippet

<

Window x:Class="CDLib.MainWindow"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:ds="clr-namespace:CDLib"

Title="MyApp" Height="513" Width="611" xmlns:my="clr-namespace:System;assembly=mscorlib">

<Window.Resources>

<ObjectDataProvider x:Key="CDEntryDataCollection"

ObjectType="{x:Type ds:CDEntryDataCollection}"/>

</Window.Resources>

<StackPanel>

<Button>Hello</Button>

<Grid>

<ScrollViewer>

<ListView ItemsSource="{Binding Source={StaticResource CDEntryDataCollection}}">

<ListView.View>

<GridView>

<GridViewColumn DisplayMemberBinding="{Binding Path=Titel}"

Header="Titel" Width="100"/>

<GridViewColumn DisplayMemberBinding="{Binding Path=Position}"

Header="Position" Width="50"/>

<GridViewColumn DisplayMemberBinding="{Binding Path=Bemerkung}"

Header="Bemerkung"/>

</GridView>

</ListView.View>

</ListView>

</ScrollViewer>

</Grid></StackPanel>

</

Window>

 

Any idea?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>