开发者

How to ensure the current item of a WPF data grid is visible?

I have a WPF DataGrid with IsSynchronizedWithCurrentItem set to true and binding it to an ObservableCollection. When use a ICollectionView.MoveCurrentTo* method to change the current item the DataGrid changes its current item accordingly.

The problem I'm having is that if the current item is not currently visible the DataGrid doe开发者_运维百科s not scroll the current item into view. How do I fix this?


You might be able to handle ICollectionView.CurrentChanged and call DataGrid.ScrollIntoView(object item) from it to achieve that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜