WPF scrollview scrolled to the bottom default

code-zoop picture code-zoop · Apr 27, 2010 · Viewed 14.1k times · Source

I have a ScrollViewer containing a ListBox. I would like the ScrollViewer to scroll all the way to the bottom by default when the view has been loaded! This because the most recent element is always the last element in the ListBox.

Is there an easy way to achieve this behavior?

Thanks

Answer

gehho picture gehho · Apr 27, 2010

If you have access to the ScrollViewer, you could also use the ScrollViewer.ScrollToBottom() method.