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

set cell background color

Thread ID:

Created:

Updated:

Platform:

Replies:

51933 Nov 16,2006 06:50 PM UTC Nov 17,2006 04:39 AM UTC Windows Forms 1
loading
Tags: GridControl
Linda
Asked On November 16, 2006 06:50 PM UTC

Hi,

I'm trying to figure out if you are able to change the background of a cell when the value of a different cell changes.
For example, within the same row, if the value of the first cell changes, I want to set the background of another cell down the row to another color.

Any help would be appreciated.

Thanks,
Linda

Administrator [Syncfusion]
Replied On November 17, 2006 04:39 AM UTC

Hi Linda,

Are you using GridDataBoundGrid? If so, please refer the below forum thread which discuss with simillar issue.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=48794

For GridControl, you can handle the CurrentCellChanging event and set the backcolor property of the cell using grid's indexer. Here is a code snippet to show this.

//Column 1 changes affect the Column 3
private void GridCellChanging(Object sender, CancelEventArgs e)
{
GridControl grid = sender as GridControl;
GridCurrentCell cc = grid.CurrentCell;
if( cc.ColIndex == 1)
grid[cc.RowIndex, 3].BackColor = Color.Blue;
}

Best Regards,
Haneef

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

;