开发者

Binding width of Gridview to width of ScrollViewer

I have a project that in which I have a RadGridView inside of a Scrollviewer. I've been trying to bind the width of the RadGridView to the width of the ScrollViewer. The ScrollViewer's width is set to Auto so that it will expand to fit the size of it's containing object, but when I bind the width of the RadGridView to the ScrollViewer it only expands to fit the information inside of the RadGridView instead of filling the remaining space of the ScrollViewer. What I would like is for the RadGridView to expand to auto fit the ScrollViewer, which开发者_如何学编程 also expands automatically to fit the parent object. However I haven't been able to find a workable solution for this problem, any ideas?


You don't really need to bind the width of the RadGridView to the ScrollViewer, just don't set the size of the RadGridView, like the following,

    <ScrollViewer Margin="60" ScrollViewer.HorizontalScrollBarVisibility="Auto">
        <telerik:RadGridView ItemsSource="{Binding Collection}"/>
    </ScrollViewer>

Please let me know if I misunderstood your question.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜