How DataBoundListBox works?

4 posts, 1 answers
  1. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 18 Feb 2013 Link to this post

    Hi,
    on one of the pages of my app I'm showing news feed. Each news feed item has a complex and dynamic layout. It may contain several images, texts and so on.
    I decided to go for lower level approach and implemented something I called MyVirtualizingPanel. Essentially it is a huge canvas, which should be placed inside scroll viewer. It tracks position of scrollviewer and loads/unloads its children based on known child height.
    More details are here:http://stackoverflow.com/questions/14739563/windows-phone-virtualized-canvas-for-more-efficient-and-flexible-list-box-is-it

    More or less it works. But. I do have problems with images: there are obvious 'lags' in scrolling when an item contains image. 
    I tried to use LowProfileImageLoader to fully control the process of loading images. It became better, but not good enough.

    Now why I'm writing in this forum: after briefly looking into the DataBoundListBox code, I see that it uses similar approach with Canvas. 

    I created test project. https://dl.dropbox.com/u/16063542/TestVirtImages.zip (just fix the references)
    It shows list of images using 4 approaches:
    - my approach (simplified) with binding to ScrollVerticalOffset
    - my approach (simplified) with handling CompositionTarget.Rendering
    - Telerik DataBoundListBox
    - Standard ListBox

    (ignore outOfMemoryException)

    It is obvious that my approach gives worse results.

    Question: what am I missing, what am I doing wrong?

    I'm going to try to look deeper into DataBoundListBox code to find the answer myself, but it might be easier if somebody who knows DataBoundListBox would have a look into my 100 lines solution.

    Will really appreciate any help. My app is almost ready, this is last thing where I got stuck.

  2. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 18 Feb 2013 Link to this post

    This is interesting situation: I can clearly see that DataBoundListBox uses the same concept internally as I do. Except that it is far more complicated. 
  3. DevCraft banner
  4. Answer
    Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 20 Feb 2013 Link to this post

    Hello Alexander,

    We won't be able to thoroughly explain the approach we're using in our control.

    If you have bought the controls you have access to the full source code and you should be able to take a look a the component is implemented.

    Let me know in case you have further questions or need assistance.

    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.
  5. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 20 Feb 2013 Link to this post

    I already looked in the code and found what makes it work better than mine. Thanks for answer anyway.
Back to Top