您的位置:首页 > 技术开发 > 正文

设置GridView指定行的特殊颜色

作者:ITPUB论坛  2008-07-11
文本Tag: 微软 sql

【IT168技术文档】

1 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 2 { 3 try 4 { 5 if (e.Row.RowType == DataControlRowType.DataRow) 6 { 7 string MyCity = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "城市")); 8 if (MyCity == this.TextBox1.Text) 9 { 10 e.Row.BackColor = System.Drawing.Color.Yellow; 11 } 12 } 13 } 14 catch (Exception MyEx) 15 { 16 Response.Write(MyEx.Message); 17 } 18 }
1
【内容导航】
第1页: 概述
©版权所有。未经许可,不得转载。
[责任编辑:nancy]
近期热评文章