if (e.Row.RowType == DataControlRowType.DataRow)
{
int esal = int.Parse(e.Row.Cells[3].Text.ToString());
if (esal > 12000)
{
e.Row.ForeColor = System.Drawing.Color.Blue;
e.Row.BackColor = System.Drawing.Color.LightPink;
e.Row.Font.Italic = true;
}
else if (esal == 15000)
{
e.Row.ForeColor = System.Drawing.Color.Brown;
e.Row.BackColor = System.Drawing.Color.LightBlue;
e.Row.Font.Italic = true;
}
else
{
e.Row.ForeColor = System.Drawing.Color.White;
e.Row.BackColor = System.Drawing.Color.LightGreen;
e.Row.Font.Italic = true;
}
}
我试过这个,但我遇到了一个异常,比如输入字符串的格式不正确..请帮助我...