0
votes

I have a scrollviewer in page which shows data vertically, and it contains controls like grid, stackpanel and listbox. Listbox contains items with expanderview. On click of expander view header it expands, I just want that whenever it expands its content get visible in page. Means i have to automatically change scroll position and make visible a Listbox selected control.

Is there any way?

2
What's the condition to scroll to the object? Do all the nested elements remain the same size? .....and most importantly, what have you tried?Chris W.
Thanks for reply, I have added more details to my question.mayank.karki

2 Answers

0
votes

There is a way to manage it Programatically with use of Timer. When the timer is triggerd, we call the timer_Tick event handler, which scrolls to the current index and marks it as selected, and then updates the index. After the last item is highlighted the index is reset to the first item. You can find useful sample here Auto-scrolling ListBox for Windows Phone

0
votes

You need to calculate the offset where you want to scroll to, and then use ScrollToVerticalOffset(your_offset_value) method.

Have a look over here : How to use ScrollViewer.ScrollToVerticalOffset?