0
Answer

Change sharepoint 2010 SPGridview cell color on condition?

Mangesh barmate

Mangesh barmate

12y
1.3k
1

I have a sharepoint 2010  SPGridview and i want to change its cell color on one condition.My condition is

string strRemoveDollar = e.Row.Cells[12].Text.ToString();

decimal theValue = Convert.ToDecimal(strRemoveDollar); 

                    if (theValue < 17) {

                        e.Row.Cells[12].BackColor = Color.Red;   }

                    else if (theValue < 10) {

                        e.Row.Cells[12].BackColor = Color.Green;  }


How i  accomplish this, where to put code so my cell color gets change on condition provided.