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

Multiple Pictureboxes of unknown size in a table

2 Answers 147 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
gipsy
Top achievements
Rank 1
gipsy asked on 04 May 2016, 08:21 AM

I have a table with one column filled with images from a database.

I don't know how big the images are and also the aspect ratio is unknown, so I have a custom function to resize them to a max. size to fit the page and set the Sizing mode of the PictureBox to "AutoSize".

Now I have the problem that the PictureBox inside a table cell always seems to be in Docking mode ("Fill"), so if there are multiple images, all will get stretched to the width of the largest one.

How can I prevent this?

 

You can easily reproduce it without a database, just put a table on the report and add different sized images to it, see the attached examples.

2 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 05 May 2016, 01:46 PM
Hello,

You can add a Panel item in the cell and then place a PictureBox on it. Thus the Panel item will be resized based on the row's height, but the PictureBox will be sized based on its settings like Size and Sizing.

In addition, you can size images to have the same dimensions in the custom function used for settings the PictureBox.Value property.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
gipsy
Top achievements
Rank 1
answered on 06 May 2016, 06:56 AM
Thanks a lot, the panel seems to do the trick!
Tags
General Discussions
Asked by
gipsy
Top achievements
Rank 1
Answers by
Stef
Telerik team
gipsy
Top achievements
Rank 1
Share this question
or