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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Themes ignored in GridControl static cell when displaying image

Thread ID:





63859 Jul 10,2007 11:29 PM UTC Jul 13,2007 05:05 AM UTC WinForms 2
Tags: GridControl
Stephen Trinder
Asked On July 10, 2007 11:29 PM UTC


I am displaying an icon in the row header cell, but have found that the Theme is being ignored when the CellType is "Static".
My grid has ThemesEnabled set to true.
I am using version

I have created an imagelist and set the BaseStylesMap["Standard"].StyleInfo.ImageList to my imagelist.

I then created a new GridStyleInfo (gsi) pointing to cell [1, 0].
I set gsi.CellType = "Static" and gsi.ImageIndex = 1, and my image does appear in the cell.

The problem is, the cell colour/style has changed back to the default row header colour.
I would have expected the cell to retain the XP Theme it had before the image was applied.

Is there any way to keep the theme and display the image?


haneefm [Syncfusion]
Replied On July 10, 2007 11:35 PM UTC

Hi Stephen,

One thing you can do is to handle the CellDrawn event, and if it is the current rowheader that has been drawn, then draw your bitmap over it. Here is code that assume the image you want to use is 0th entry in the ImageList, this.imageList1.

private void grid_CellDrawn(object sender, GridDrawCellEventArgs e)
if(e.ColIndex == 0 && e.RowIndex >0 )
Rectangle rect = GridUtil.CenterInRect(e.Bounds, this.imageList1.ImageSize);
GridStaticCellRenderer.DrawImage(e.Graphics, this.imageList1, 0, rect, false);

Best regards,

Stephen Trinder
Replied On July 13, 2007 05:05 AM UTC

Hi Haneef.

That's works great, thanks for your help.



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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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