We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Highlighting the cell based on the cell value


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.



Your may try the code:

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.