Multiple Pictureboxes of unknown size in a table

3 posts, 1 answers
  1. gipsy
    gipsy avatar
    2 posts
    Member since:
    Oct 2013

    Posted 04 May Link to this post

    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. Answer
    Stef avatar
    2914 posts

    Posted 05 May Link to this post


    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.

    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
  3. DevCraft R3 2016 release webinar banner
  4. gipsy
    gipsy avatar
    2 posts
    Member since:
    Oct 2013

    Posted 06 May Link to this post

    Thanks a lot, the panel seems to do the trick!
Back to Top