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

Scrolling to a randomly selected item?

7 Answers 113 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Craig
Top achievements
Rank 2
Craig asked on 07 Oct 2011, 08:49 AM
Hello,

   I have a List of just over 100 items and I have a button that randomly selects one of the items.  Using the built-in list box I would just call "list.ScrollIntoView(list.Items[i])" and it would, well, scroll into view.  How do I do this in a DataBoundListBox?

Craig.

7 Answers, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 07 Oct 2011, 11:33 AM
Hi Craig,

Thanks for contacting us and for your question. You can use the BringIntoView method of RadDataBoundListBox to achieve the same.

Let me know if you need further assistance with this.

Regards,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Craig
Top achievements
Rank 2
answered on 07 Oct 2011, 02:28 PM
Yeah, that worked just like advertised.  Of course, now that I look at it, it isn't very Metro.  Is there a way to make it animate from one selection to another?  Perhaps with a little bounce at the end?  That would be awesome. :)

Thanks!!

0
Deyan
Telerik team
answered on 07 Oct 2011, 03:06 PM
Hello Craig,

Thanks for writing back.

Currently, there is no an out-of-the-box way to animate what BringIntoView does. However, with the Q3 version of our suite we will provide support for item animations in RadDataBoundListBox. I believe that with this functionality you could bring some freshness to your app. Make sure to follow our blogs where we will officially announce all new features and will make demonstrations.

Do not hesitate to write back in case you have further questions or need assistance.

Best wishes,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
JDBPocketware
Top achievements
Rank 2
answered on 31 Jan 2014, 02:31 PM
Can it be done animated if item is in viewport?
0
JDBPocketware
Top achievements
Rank 2
answered on 31 Jan 2014, 03:09 PM
[quote]Jandieg said:Can it be done animated if item is in viewport?[/quote]

Edit: just tried this and works:
var scroll = lst.ChildrenOfType<ScrollViewer>().First();
scroll.ScrollToHorizontalOffset(x);

It should work for an animation by looping ScrollToHorizontalOffset. Or is there an optimal way?
0
Deyan
Telerik team
answered on 05 Feb 2014, 08:04 AM
Hi Jandieg,

Thanks for writing back.

You can use this approach but you will have to make sure to trigger the UI virtualization logic as well. But since we do not support it officially, we do not guarantee you that it will flawlessly work.

Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
JDBPocketware
Top achievements
Rank 2
answered on 11 Feb 2014, 09:29 PM
Yes it actually not smooth. If anyone knows a better workaround or has a sample please share.
Tags
DataBoundListBox
Asked by
Craig
Top achievements
Rank 2
Answers by
Deyan
Telerik team
Craig
Top achievements
Rank 2
JDBPocketware
Top achievements
Rank 2
Share this question
or