开发者

Scroll to and select final row in a DataGrid

开发者 https://www.devze.com 2023-02-12 07:44 出处:网络
How do I make a WPF Toolkit DataGrid scroll to and select the bottom row without using the code behind?

How do I make a WPF Toolkit DataGrid scroll to and select the bottom row without using the code behind?

For context, when the user wants to add a new row to the table I don't want them to have to scroll throug开发者_如何学Ch hundreds of rows to get to the bottom.


You can use the DataGrid.ScrollIntoView() method

Check the below links

WPF DataGrid - How to stay focused on the bottom of the DataGrid as new rows are added?

How to autoscroll on WPF datagrid

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f651812c-95db-436e-a98e-d5eeccb779e5/


This will scroll/focus to the bottom of the grid

dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.RowCount-1;
0

精彩评论

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