坚持139

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

ASP.NET 可以对GridView中某一行设置特定颜色,通过判断其中列Updated是否为空。

 

 1     protected void GridViewSalesGroup_RowDataBound(Object sender, GridViewRowEventArgs e)
2 {
3 if (e.Row.RowType == DataControlRowType.DataRow)
4 {
5 string updatedDate = (string)DataBinder.Eval(e.Row.DataItem, "Updated");
6 if (updatedDate == "")
7 {
8 e.Row.BackColor = System.Drawing.Color.LightPink;
9 e.Row.ForeColor = System.Drawing.Color.Maroon;
10 }
11 }
12
13 }

 

posted on 2011-11-17 14:27  坚持139  阅读(1197)  评论(0编辑  收藏  举报