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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Image not being drawn in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

13079 Apr 20,2004 05:44 AM UTC Apr 21,2004 04:42 AM UTC WinForms 2
loading
Tags: GridControl
Simon Weaver
Asked On April 20, 2004 05:44 AM UTC

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

Administrator [Syncfusion]
Replied On April 20, 2004 05:04 PM UTC

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

Administrator [Syncfusion]
Replied On April 21, 2004 04:42 AM UTC

that did it :) thanks

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;