开发者

Prevent Automatic Horizontal Scroll On Selected TreeView Item

When a TreeViewItem is selected, the horizontal and vertical scrollbars adjust so it开发者_开发技巧's in view. I like the vertical scrollbar behavior, but I want to stop the horizontal one. Disabling the horizontal scrollbar has no effect.


Try using the ScrollViewer.HorizontalScrollBarVisability and setting it to Disabled.

<TreeView Width="100" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
        <TreeViewItem Header="This is a very long header with a small width..................123"/>
    </TreeView>


This may guide you ...

Key is to handle BringIntoView event at tree view item level before scrollviewer receives it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜