焦点定位到最后一行

1 // 将焦点定位到最后一行
2 var border = VisualTreeHelper.GetChild(yourDataGridName, 0) as Decorator;
3 if (border != null)
4 {
5   var scroll = border.Child as ScrollViewer;
6   if (scroll != null) scroll.ScrollToEnd();
7 }

 

posted @ 2021-08-30 09:26  llkj  阅读(30)  评论(0编辑  收藏  举报