首页 > 其他 > 详细

循环GridView

时间:2017-02-07 15:16:13      阅读:242      评论:0      收藏:0      [点我收藏+]

//鼠标覆盖则变色该行
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!