Gridview行随鼠标变色
生活随笔
收集整理的這篇文章主要介紹了
Gridview行随鼠标变色
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在GridView的RowDataBound()事件添加如下代碼:
?1?????protected?void?GridView1_RowDataBound(object?sender,?GridViewRowEventArgs?e)
?2?????{
?3?????????if?(e.Row.RowType?==?DataControlRowType.DataRow)
?4?????????{
?5?????????????//鼠標(biāo)經(jīng)過(guò)時(shí),行背景色變?
?6?????????????e.Row.Attributes.Add("onmouseover",?"this.style.backgroundColor='#E6F5FA'");
?7?????????????//鼠標(biāo)移出時(shí),行背景色變?
?8?????????????e.Row.Attributes.Add("onmouseout",?"this.style.backgroundColor='#FFFFFF'");
?9?????????}?
10?????}
11?
12?
?1?????protected?void?GridView1_RowDataBound(object?sender,?GridViewRowEventArgs?e)
?2?????{
?3?????????if?(e.Row.RowType?==?DataControlRowType.DataRow)
?4?????????{
?5?????????????//鼠標(biāo)經(jīng)過(guò)時(shí),行背景色變?
?6?????????????e.Row.Attributes.Add("onmouseover",?"this.style.backgroundColor='#E6F5FA'");
?7?????????????//鼠標(biāo)移出時(shí),行背景色變?
?8?????????????e.Row.Attributes.Add("onmouseout",?"this.style.backgroundColor='#FFFFFF'");
?9?????????}?
10?????}
11?
12?
轉(zhuǎn)載于:https://www.cnblogs.com/kevins/archive/2008/08/14/1267609.html
總結(jié)
以上是生活随笔為你收集整理的Gridview行随鼠标变色的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 局域网聊天室 -ChatServer
- 下一篇: FLEX实例:GOOGLE地图.