This is a migrated thread and some comments may be shown as answers.

Auto Scroll To New Item inside Scrollviewer

1 Answer 348 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
heavywoody
Top achievements
Rank 1
heavywoody asked on 11 May 2014, 01:46 AM
I have a usercontrol that has a Listbox of Listboxes.   That usercontrol is put inside a Scrollviewer.   I have made a sample application I have attached a link to.  My real version uses MVVM, so please keep that in mind.   What I am trying to accomplish is if a new item is added to the listboxes in the Usercontrol, how can I make the Scrollviewer on the MainWindow scroll to where the new item was just added add the end of whatever listbox it was added?

https://www.dropbox.com/s/dia9ri3h63ne4aq/ListScrollExample.zip

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 12 May 2014, 12:33 PM
Hello Christian,

In order to achieve the desired functionality in the specific scenario you would need to manually move the ScrollViewer to the needed location by using its ScrollToHorizontalOffset method. However you would also need to manually calculate how much to scroll in order to show the last item of each ListBox. For your convenience I have modified the provided project in order to demonstrate the exact approach.

Hope this helps.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ListBox
Asked by
heavywoody
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or