1 public void productsGridView_RowDataBound(object sender,
2 GridViewRowEventArgs e)
3 {
4 if (e.Row.RowType == DataControlRowType.DataRow) //检查是否为datarow
5 {
6 int num = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Number")); //取得数据
7 if (num == 0) //0库存
8 {
9 e.Row.BackColor = Color.Blue; //颜色突出显示
10 }
11 }
12 }
2 GridViewRowEventArgs e)
3 {
4 if (e.Row.RowType == DataControlRowType.DataRow) //检查是否为datarow
5 {
6 int num = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Number")); //取得数据
7 if (num == 0) //0库存
8 {
9 e.Row.BackColor = Color.Blue; //颜色突出显示
10 }
11 }
12 }