Hi
Set image by cell.style backgroundimage
=> the background images are not shown in the cells that are visible on start, only in the cells not visible on start, after scroll down the background images are visible
=> the positioning of the images is not working properly:
cell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
cell.Style.BackgroundImageAlign = ContentAlignment.MiddleCenter;
cell.Style.BackgroundImageLayout = ImageLayout.Zoom;
the images are always positioned at top of the cell
Hi Luca
for reproduction of the drag drop problem, see the attached project. Column2 in the datagridview has mixed contents with text and images. DragDrop works well as long as you begin drag within a cell “outside” of the image area. As soon as you drag the image dragdrop doesn’t work anymore.
WJ-7809: Bug: Cached rows in a DGV control may lose the background image when retrieved from the cache.
WJ-7810: Enhancement: Add ImageLayout.BestFit and ImageLayout.OriginalSize.
Let me know about the drag&drop issues, I can’ reproduce that one.
Thanks,
Luca
Yes, I see. The problem is that the theme sets the background image at 24px 24px because of svg icons, otherwise svg icons are all quite big when using their natural dimension. The BackgroundImage property was added originally to support icons in cells. I have to see if we can override the theme without having to create a mixin under a combination of properties that makes sense.
About the other issues:
Logged both issues.
Thanks,
Luca
Hi Luca
But then the ascpect ratio of the image is not properly displayed as you see in Column2, Column1 (with AllowHTML=true and a image url, but then DragDrop does not work) shows the image properly.
And the other problem with the background image not shown in the first screen, you dont’t see? Pleas have a look on the attached screeshot
It seems to work well. The problem is that you can’t zoom and center at the same time. I tried your sample, commented out the zoom line and this is what I get using MiddleCenter: