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

How to avoid jerky behaviour

3 Answers 51 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.
selom
Top achievements
Rank 1
selom asked on 20 Apr 2013, 02:20 PM
I'm using a databoundlistbox with a lot of images. I found that the template jumps while scrolling because some images load later than others. For example, images 5-10 will load, but if image 3 loads while looking at image 5 the list "jumps" to re-calculate the layout which is normal.

Can I prevent the jerkyness if I already know the dimensions of image 3 before it actually loads? I found setting the width/height of the image does not help because the actual width/height in pixels is not the width/height of the image when it's in the container (shrunk to fit). Is there a way to extrapolating this value so I can force the container to be a certain size? Any tips would help.

Edit: nm, setting the width/height on the wrong container

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 22 Apr 2013, 07:04 AM
Hi Selom,

Just set the Width/Height of the layout container that holds the image element in your Item Template. If you do not have a layout container, put the Image element in a Grid and set the dimensions of the Grid element.

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.
0
Anton
Top achievements
Rank 1
answered on 23 Apr 2014, 08:25 AM
I experience similar issue with databoundlistbox. Items have itemspanels inside and it's impossible to determine height of items at design time. I wonder if elegant solution exists?
0
Deyan
Telerik team
answered on 25 Apr 2014, 02:13 PM
Hi Anton,

Thanks for writing.

If the size of the items cannot be determined at the point the containers are measured you will have to explicitly define a fixed size to avoid having your items change their size as soon as the picture is downloaded.

Regards,
Deyan
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.

 
Tags
DataBoundListBox
Asked by
selom
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Anton
Top achievements
Rank 1
Share this question
or