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

Autoscroll the Listbox / Gridview

2 Answers 213 Views
CollectionNavigator
This is a migrated thread and some comments may be shown as answers.
Dirk
Top achievements
Rank 1
Dirk asked on 20 Jun 2017, 05:53 PM

Hello,

i used your example of the documentation, about the RadCollectionNavigator, but I did not found any information how to autoscroll the Listbox, if the MovetoNextButton or MoveToLastItem is clicked and the Listbox size is to small to show all item without scrollbar.

Does the Controls have such kind of feature out of the box and best case MVVM friendly? Or do you have any suggestion how to implement this feature for a good customer experience? If possible I would like to avoid the datapager control.

Best regards,

Dirk

2 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 23 Jun 2017, 11:58 AM
Hello Dirk,

In order to achieve the desired behavior, you can handle the SelectionChanged event of the ListBox like so:

private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    var listbox = sender as ListBox;
    var item = e.AddedItems[0];
    listbox.ScrollIntoView(item);
}

Please let me know if this works for you.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Dirk
Top achievements
Rank 1
answered on 27 Jun 2017, 09:59 PM

Hello Dilyan,

works well.

 

Bets regards,

Dirk

Tags
CollectionNavigator
Asked by
Dirk
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Dirk
Top achievements
Rank 1
Share this question
or