如何使鼠标经过datagrid的列时,该列背景色改变
2006-04-22 10:01
288 查看
在事件ItemDataBound中添加下面的代码段:
if (e.Item.ItemType ==ListItemType.Item || e.Item.ItemType ==ListItemType.AlternatingItem )
{
e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor); this.style.cursor='hand';this.style.backgroundColor='Green'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');");
e.Item.Attributes.Add("onmousedown","this.style.cursor='hand';this.style.backgroundColor='red'");
e.Item.Attributes.Add("onmouseup","this.style.backgroundColor=this.getAttribute('BKC');");
}
if (e.Item.ItemType ==ListItemType.Item || e.Item.ItemType ==ListItemType.AlternatingItem )
{
e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor); this.style.cursor='hand';this.style.backgroundColor='Green'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');");
e.Item.Attributes.Add("onmousedown","this.style.cursor='hand';this.style.backgroundColor='red'");
e.Item.Attributes.Add("onmouseup","this.style.backgroundColor=this.getAttribute('BKC');");
}
相关文章推荐
- DataGrid GridView 隔行换色 鼠标经过改变背景色
- DataGrid GridView 隔行换色 鼠标经过改变背景色
- GridView的小技巧(1)--如何实现鼠标划过改变GridView的行背景色
- asp.net2.0鼠标移到GridView某一行如何改变该行的背景色
- jQuery学习心得----鼠标经过时改变table行的背景色
- ASP.NET基础教程-DataGrid表格控件-利用ItemDataBound事件实现鼠标移动到控件的某一行时改变该行的背景色
- 鼠标经过单元格改变背景色
- 如何使鼠标经过按钮时按钮的图像发生改变
- 如何实现table背景色随鼠标移动改变颜色?
- javascript鼠标经过背景色和字体颜色改变
- DataGrid实现鼠标放到某行改变背景色
- 当鼠标移过来至datagrid时背景色改变效果
- GridView的小技巧(1)--如何实现鼠标划过改变GridView的行背景色
- Winform DataGrid设计三步曲之三----如何改变DataGrid的背景色
- winfrom 树形控件如何实现鼠标经过节点时光标颜色改变效果
- jsp制作复合表头并循环产生表格内容,控制隔行变色、鼠标经过改变背景色等操作
- AspXGridView鼠标经过如果改变行背景色
- 如何在Flex3中获取鼠标经过DataGrid时所在的行列索引
- AspXGridView鼠标经过改变行背景色与自定义列显示内容