Search code examples
wpfscrollwpftoolkit

Scroll to and select final row in a DataGrid


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 through hundreds of rows to get to the bottom.


Solution

  • 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/