How to get a ScrollViewer to be an exact height *and* show both scrollbars at all times?
-
20-09-2019 - |
Question
I have a DataGrid inside a ScrollViewer.
I want the whole thing to only be 200 pixels high.
But this code:
<ScrollViewer x:Name="DataGridArea" Height="200">
<toolkit:DataGrid ItemsSource="{Binding FieldChanges}"/>
</ScrollViewer>
produces this with the scrollbar only on the right side:
alt text http://www.deviantsart.com/upload/8lhu03.png
and I can only see the scrollbar when I scroll down to the bottom:
alt text http://www.deviantsart.com/upload/a9oikp.png
What do I have to do so that my ScrollViewer is 200 pixels high AND both scrollbars are present at all times?
Solution
What happens if you set VerticalScrollBarVisibility
and HorisontalScrollBarVisibility
to Visible
on the ScrollViewer
?
OTHER TIPS
I think you need to set the height of the ScrollViewer's content (the DataGrid).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow