Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
dimpledevani 3-Dec-12 6:46am    
Try the RowDataBound event of SPGridView

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900