protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (Convert.ToInt32(e.Row.Cells[6].Text < 30))
//找到库存的索引,设定数量小于30时变颜色
{
e.Row.Cells[6].BackColor = System.Drawing.Color.Red;
//设计颜色变化为红色
}
}
}
gridview中某列值小于一定数量时字体为红色
最新推荐文章于 2020-04-04 20:52:55 发布