Scroll To Header

4 posts, 0 answers
  1. Dave Baumann
    Dave Baumann avatar
    6 posts
    Member since:
    Mar 2010

    Posted 07 May 2013 Link to this post

    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

  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 13 May 2013 Link to this post

    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.
  3. DevCraft banner
  4. Dave Baumann
    Dave Baumann avatar
    6 posts
    Member since:
    Mar 2010

    Posted 13 May 2013 Link to this post

    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.
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 13 May 2013 Link to this post

    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.
Back to Top
DevCraft banner