I have a xaml page that has a grid with two listbox inside. I want the grid to scroll through the listboxes and this is working, but only if I scroll from outside the listbox area. I want the listboxes to propagate the scroll to the grid, as themselves does not have any scrolling bar.
This is my code:
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ListBox BorderBrush="Red" BorderThickness="2" Grid.Row="0" ItemsSource="{Binding Path=PinpadPaymentBrandControlList, ElementName=PbUserControl}" x:Name="RadioPbList"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode ="Single"
SelectionChanged="RadioPbList_SelectionChanged">
<ListBox.ItemTemplate >
...
</ListBox.ItemTemplate >
</ListBox>
<ListBox BorderBrush="Red" BorderThickness="2" Grid.Row="0" ItemsSource="{Binding Path=PinpadPaymentBrandControlList, ElementName=PbUserControl}" x:Name="RadioPbList"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode ="Single"
SelectionChanged="RadioPbList_SelectionChanged">
<ListBox.ItemTemplate >
...
</ListBox.ItemTemplate >
</ListBox>
</Grid>
</ScrollViewer>
I tried using the ScrollViewer.CanContentScroll="True" in the ListBox tag, but it didn't work either. Any help? I'm not used to using xaml so I might be doing it pretty much wrong