How to autoscroll on WPF datagrid

后端 未结 17 952
甜味超标
甜味超标 2020-12-08 09:27

I think I am stupid. I searched now for 15 minutes, and found several different solutions for scrolling on datagrids, but none seems to work for me.

I am using WPF w

17条回答
  •  自闭症患者
    2020-12-08 10:30

    When you are use datagridview with the scrollbar must use this technique. becuase i was try other technique. but those are not work properly....

    var border = VisualTreeHelper.GetChild(mainDataGrid, 0) as Decorator;
    if(border != null)
    {   var scroll = border.Child as ScrollViewer;
        if (scroll != null) scroll.ScrollToEnd(); 
    }
    

提交回复
热议问题