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

Background Image and Cell Interior

Thread ID:





41950 Mar 15,2006 05:21 PM UTC Mar 16,2006 08:19 AM UTC WinForms 2
Tags: GridControl
Riccardo Tarli
Asked On March 15, 2006 05:21 PM UTC

Hi, we would like to have a background image in our grid control, and at the same time the capability to change the cell background color of any cell. It seems that if a backgroud image is specified, then the cell background color can''t change. Any suggestion ? Thanks in advance Riccardo

Administrator [Syncfusion]
Replied On March 16, 2006 06:48 AM UTC

Hi Riccardo, Setting the BackgroundImage will set the TransparentBackground property to true and this has the higher precedence over the backcolor property. Hence this causes the issue. To have both image and backcolor, you can use the FillRectangle method in the DrawCell event. Here is the code snippet. private void gridControl1_DrawCell(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e) { if(e.RowIndex == 4) { SolidBrush br = new SolidBrush(Color.PaleGreen); e.Graphics.FillRectangle(br, e.Bounds); br.Dispose(); } } Let us know if this helps. Best regards, Madhan.

Riccardo Tarli
Replied On March 16, 2006 08:19 AM UTC

It works. Thanks a lot Madhan. Riccardo


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