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

Trying to change the cells back color

Thread ID:

Created:

Updated:

Platform:

Replies:

14961 Jun 8,2004 08:43 PM UTC Jun 8,2004 09:02 PM UTC WinForms 2
loading
Tags: GridControl
Gulshan Khera
Asked On June 8, 2004 08:43 PM UTC

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 08:50 PM UTC

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 09:02 PM UTC

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.

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

;