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;
精彩评论