【WPF】Datagrid显示最低下一跳

        ScrollViewer scroll;
        private void GridView_ScrollChanged(object sender, RoutedEventArgs e)
        {
            if (scroll == null)
            {
                DataGridAutomationPeer lvap = new DataGridAutomationPeer(sender as DataGrid);
                var svap = lvap.GetPattern(PatternInterface.Scroll) as ScrollViewerAutomationPeer;
                ScrollViewer scroll = svap.Owner as ScrollViewer;
                scroll.ScrollToBottom();
            }
        }

源:mulinyeyu

posted @ 2017-11-14 11:22  oiliu  阅读(445)  评论(0编辑  收藏  举报