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

How DataBoundListBox works?

3 Answers 74 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.
Alexander
Top achievements
Rank 1
Alexander asked on 18 Feb 2013, 06:24 PM
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.

3 Answers, 1 is accepted

Sort by
0
Alexander
Top achievements
Rank 1
answered on 18 Feb 2013, 10:50 PM
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. 
0
Accepted
Deyan
Telerik team
answered on 20 Feb 2013, 12:55 PM
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.
0
Alexander
Top achievements
Rank 1
answered on 20 Feb 2013, 03:14 PM
I already looked in the code and found what makes it work better than mine. Thanks for answer anyway.
Tags
DataBoundListBox
Asked by
Alexander
Top achievements
Rank 1
Answers by
Alexander
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or