Highlighting the cell based on the cell value

Hello,

I am using GridWeb control. My requirement is as below:

I have associated a formula with a cell. Let us say C3=C1+C2. Now, I want that whenever C3 results to a number greater than say 200, the backcolor of the cell C3 should change (say from white to yellow). Can it be done?

A quick response would be appreciated.

Thanks.

Hi,

Your may try the code:

GridWeb1.WebWorksheets.ImportExcelFile(“e:\test\Book1.xls”);
GridWeb1.WebWorksheets.RunAllFormulas();
WebCells cells = GridWeb1.WebWorksheets[0].Cells;

WebCell cell = cells[2, 2];
if (cell.Formula != null && Convert.ToDouble(cell.Value) >200)
{
cell.Style.BackColor = System.Drawing.Color.Yellow;
}


Thank you.