开发者

How to get a ScrollViewer to be an exact height *and* show both scrollbars at all times?

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开发者_如何学JAVA 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?


What happens if you set VerticalScrollBarVisibility and HorisontalScrollBarVisibility to Visible on the ScrollViewer ?


I think you need to set the height of the ScrollViewer's content (the DataGrid).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜