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

Scroll To Header

3 Answers 59 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.
Dave Baumann
Top achievements
Rank 1
Dave Baumann asked on 07 May 2013, 09:22 PM
I have added ListHeaderTemplate to the RadDataBoundListBox control on one of the pages in my application. I can use BringIntoView() to Scroll to the first item in the underlying collection but the header is still hidden. I would like to be able to scroll to the top of the control and bring the header into view as well.

I have thought about adding a DataTemplateSelector as the ItemTemplate for the ListBox and just add the information the header is bound to as the first item in the list but the information in the header is different from the list itself. This would require modifications to other areas of the codebase which I would like to avoid if possible.

I have also tried InvalidateArrange() followed by UpdateLayout() to no avail.

Any suggestions?

Thanks,

Dave

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 13 May 2013, 06:45 AM
Hello Dave,

Thanks for writing and please excuse us for the delay with our answer.

The way DataBoundListBox currently works implies that the item which is brought into view is positioned at the top of the viewport. Since the Header item is just a service item which is not part of the source collection, it cannot be used in the BringIntoView context.

The idea of introducing a special item in your source with a custom template is a good one. You can simply inherit from your standard view-models, add a property which defines the header content and use it in the header template in the Template Selector you will implement.

Let me know if you need further assistance here.

Greetings,
Deyan
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Dave Baumann
Top achievements
Rank 1
answered on 13 May 2013, 08:07 AM
Thanks for your reply.

I already have a template selector and a complicated data pull that is the source of this list. The display items are split into no less than 9 templates. The header data is a separate data pull that (should) happens after the initial pull to populate the list. Synchronizing the data pulls would be rather complicated without affecting the user experience and changing the shape of the source to include the header data does not make sense from a domain perspective. 

Scrolling to the very top of the control (the databound list) even if a header is present seems like something that would be useful and relatively easy to accomplish. The LongListSelector in the windows phone toolkit used to have this as an option. In fact, it was called ScrollToTop.

I have put in a feature request as suggested in the tooltip in your signature.
0
Deyan
Telerik team
answered on 13 May 2013, 12:37 PM
Hi Dave,

Thanks for writing back.

We will consider your request and will try to extend the functionality of the control to allow you to customize the way BringIntoView is used.

Thanks for your feedback and let us know in case you have further questions or need assistance.

Kind regards,
Deyan
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
DataBoundListBox
Asked by
Dave Baumann
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Dave Baumann
Top achievements
Rank 1
Share this question
or