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

Go top with ListHeader

2 Answers 12 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.
Vinh
Top achievements
Rank 1
Vinh asked on 02 Sep 2014, 03:34 AM
I'm using RadDataBoundListBox for my project. It's realy good but I dont know how to scroll to top of list when I use ListHeader too. The method BringIntoView just scroll to top item, but not ListHeader. Please help me. Thank you

2 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 04 Sep 2014, 05:56 PM
Hi Vinh,

Thank you for contacting us.

Indeed the BringIntoView() method works only with items from the ItemsSource of the RadDataBoundListBox. What you can do is to find the internal ScrollContentPresenter and set its offset to 0. You will have to do this twice because of the UI virtualization of the listbox items - if the header element has been recycled, then the first time you set the scroll offset to 0, it will scroll to the first item. After the items are realized, you will have to scroll again to offset 0. I have attached a sample project that demonstrates how to do this.

I hope this helps. Please, let us know if you have further questions.

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Vinh
Top achievements
Rank 1
answered on 05 Sep 2014, 12:46 AM
Thank you. It worked :D
Tags
DataBoundListBox
Asked by
Vinh
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Vinh
Top achievements
Rank 1
Share this question
or