码迷,mamicode.com
首页 > 其他好文 > 详细

循环GridView

时间:2017-02-07 15:18:06      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:protected   back   color   ack   view   control   seo   背景色   覆盖   

//鼠标覆盖则变色该行
protected void dataTable_RowDataBound(object sender, GridViewRowEventArgs e){

if(e.Row.RowType == DataControlRowType.DataRow){

//当鼠标停留时更改背景色
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor=‘#7a7b7d‘");

//当鼠标移开时还原背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");

//循环GridView每一行
var i=e.Row.RowIndex;

//循环找每一行的控件
e.Row.FindControl("控件ID")

循环GridView

标签:protected   back   color   ack   view   control   seo   背景色   覆盖   

原文地址:http://www.cnblogs.com/illegal/p/6374040.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!