Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1105
UltraGridCell appearance.image sizing
posted

I have a column where I'm setting an image in the appearance of the cell (i.e. cell.Appearance.Image =)  Not every cell in the column will have the same image, but all images are of the same size.  Call this Column A.

At the same time, another column contains images via the cell value being of System.Drawing.Image.  The size of the image in this column will always be larger (both height and width) than the image in the other column.  Call this Column B.

I have RowSizing set to fixed because I don't want the user to be able to resize rows.  However, in the InitializeRow method, I examine the size of the image in Column B (if it exists, it doesn't have to unlike column A).  I then set the row size to be the height of the image in column B.

The problem I have is that the size of the image in column A grows to the height of the row, and I don't want it to.  I want it to maintain the same size no matter how the row is sized.

I've looked into using a draw filter to manually set the rect of the ImageUIElement.  But it seems to disregard my sizes when the row gets resized.

Essentially what I need is for the ImageUIElement to not autosize itself (which it appears to do) when the row resizes.

Any help would be appreciated.  Thanks!

 

Chris Rowland

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Chris,

    What version of the grid are you using? I tested this out and the size of the image applied to the cell via the Appearance does not change based on the height of the row.

    Perhaps this is a bug in an old version of the grid that has been fixed?

    If that is the case, and you are using an old version of the grid and you cannot upgrade and you want to work around this, you shouldn't try to change the sizes of UIElements in a DrawFilter, this is more the province of a CreationFilter.

     

Children