首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

改变gridview选中国人民银行的背景色

2012-10-06 
改变gridview选中行的背景色?protected void gridView_OnRowCreated(object sender, GridViewRowEventArgs

改变gridview选中行的背景色

?protected void gridView_OnRowCreated(object sender, GridViewRowEventArgs e)

?? ? ? ?{

?

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

?? ? ? ? ? ?{

?? ? ? ? ? ? ? ?e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor; this.style.backgroundColor='#CCCCCC'");

?? ? ? ? ? ? ? ?//变量c用与存储鼠标移动在行上时,原来的背景色,然后设置为'#CCCCCC'

?? ? ? ? ? ? ? ?e.Row.Attributes.Add("onmouseout", " this.style.backgroundColor=c");

?? ? ? ? ? ? ? ?//当鼠标离开时,还原背景色

?? ? ? ? ? ?}

?

?? ? ? ?}

热点排行
Bad Request.