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.

Trying to change the cells back color

Thread ID:

Created:

Updated:

Platform:

Replies:

14961 Jun 8,2004 04:43 PM Jun 8,2004 05:02 PM Windows Forms 2
loading
Tags: GridControl
Gulshan Khera
Asked On June 8, 2004 04:43 PM

Hi I am trying to change the cell back color in CellDrawn Event using the following code. if(e.RowIndex > 0) { e.Style.BackColor = Color.Red; } else { e.Style.BackColor = Color.BurlyWood; } Its not changing the color any suggestion are appreciated Thanks Gulshan

Administrator [Syncfusion]
Replied On June 8, 2004 04:50 PM

The CellDrawn event occurs AFTER the cell is drawn. So, trying to set the backcolor there will not do anything. Instead, use the PrepareViewStyleInfo event, and set the bckColor there using similar code.

Gulshan Khera
Replied On June 8, 2004 05:02 PM

Got the point Thanks Clay >The CellDrawn event occurs AFTER the cell is drawn. So, trying to set the backcolor there will not do anything. > >Instead, use the PrepareViewStyleInfo event, and set the bckColor there using similar code.

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.

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.

;