zoukankan
html css js c++ java
如何实现鼠标移到DataGrid控件的某一行时改变该行的背景
private
void
DataGrid1_ItemDataBound(
object
sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
//
当鼠标移到表的行上时改变行的颜色
//
如果是数据项并且是交替项
if
(e.Item.ItemType
==
ListItemType.Item
||
e.Item.ItemType
==
ListItemType.AlternatingItem)
{
//
添加自定义属性,当鼠标移过来时设置该行的背景色为"6699ff",并保存原背景色
Panel body
=
(Panel)e.Item.FindControl(
"
Panel1
"
);
body.Attributes.Add(
"
onmouseover
"
,
"
currentcolor=this.style.backgroundColor;this.style.backgroundColor='#99ccff'
"
);
//
添加自定义属性,当鼠标移走时还原该行的背景色
body.Attributes.Add(
"
onmouseout
"
,
"
this.style.backgroundColor=currentcolor
"
);
}
}
查看全文
相关阅读:
VS2010中ActiveX控件"未能实例化activex控件 因为这需要设计时授权"解决办法
CreateThread,_beginthread与AfxbeginThread之间的区别
C的定时器timeSetEvent使用
GetCurrentTime(),GetLocalTime(),GetSystemTime()之间的区别
使用PostThreadMessage在Win32线程间传递消息
c++配置文件.ini,GetPrivateProfileString( )WritePrivateProfileString( )
Callback函数详解
Dispose,using
mysql 存储过程,表
函数,视图,存储过程,触发器,sysobjects (系统对象表),事务,异常
原文地址:https://www.cnblogs.com/ahuang1118/p/172538.html
最新文章
如何删除顽固的node_modules
mac安装ubuntu虚拟机
iOS 'The sandbox is not sync with the Podfile.lock'问题解决
iOS: FFmpeg编译和使用问题总结
【iOS开发】canOpenURL: failed for URL
从零开始,让你的框架支持CocoaPods
iOS中定时器NSTimer的开启与关闭
iOS---通过正则判断手机号码
外边距margin 合并
为何要清除浮动clear:both?
热门文章
函数4---函数表达式、闭包
css sprite
浅析less
浏览器http缓存
进程管理
函数2---call、apply、bind
函数3---arguments对象
函数1---this指向
C/C++中的联合体
CStatic控件的基本使用
Copyright © 2011-2022 走看看