We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Image not being drawn in grid

In the DrawCell event I am drawing a small image in one of the cells. private void gridAssignments_DrawCell(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e) { e.Graphics.DrawImage(ledImage, (int) (e.Bounds.X + (e.Bounds.Width - ledImage.Width)/2), ((int) e.Bounds.Y + (e.Bounds.Height - ledImage.Height) / 2)); } The grid is set to be a listbox styled grid. Now this all works fine if i use the arrow keys to move up and down. The gray highlighted row shows the image in it. However if I click a row then the image appears on mousedown (highlighted in grey) but on mouseup it then disappears, presumably being overwritten by the gray bar. It seems odd that it works with keys but not clicks. How can I fix this? thanks, simon

2 Replies

AD Administrator Syncfusion Team April 20, 2004 01:04 PM

Instead of using the DrawCell event, try using the CellDrawn event instead.


AD Administrator Syncfusion Team April 21, 2004 12:42 AM

that did it :) thanks

Loader.
Live Chat Icon For mobile
Up arrow icon