How GridView value changes according to the color of a column of the row [question points: 30 points, knot tie people wsdydmw]
protected
void
GridView1_RowDataBound(
object
sender, GridViewRowEventArgs e)
{
if
(e.Row.RowIndex >= 0)
{
double
number1 =
double
.Parse(e.Row.Cells[2].Text.ToString());
//数量1
double
number2 =
double
.Parse(e.Row.Cells[5].Text.ToString());
//数量2
if
(number1 < number2 )
{
e.Row.BackColor = System.Drawing.Color.SkyBlue;
//显示颜色,可自定义
}
}
}