鼠标停留在GridView某行的颜色改变
2008-06-04 03:14
302 查看
1、protected void gvdegreetype_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='GhostWhite'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
}
}
2、 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//当鼠标移到的时候设置该行颜色为"", 并保存原来的背景颜色
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699CC'");
//当鼠标移走时还原该行的背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='GhostWhite'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
}
}
2、 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//当鼠标移到的时候设置该行颜色为"", 并保存原来的背景颜色
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699CC'");
//当鼠标移走时还原该行的背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
}
相关文章推荐
- 鼠标停留在GridView某一行时,行的颜色改变
- 鼠标停留在GridView某一行时颜色改变
- 鼠标停留在GridView某一行时颜色改变
- 鼠标停留在GridView某一行时 行的颜色改变
- 鼠标停留在GridView某一行时行的颜色改变
- 鼠标停留在GridView某一行时,行的颜色改变
- 鼠标停留在GridView某一行时行的颜色改变
- gridview鼠标经过某行改变样式、颜色并且单击弹出窗口
- GridView扩展鼠标经过改变行的颜色
- gridview repeater DataList 鼠标经过改变背景颜色
- gridview repeater DataList 鼠标经过改变背景颜色
- Asp.Net中GridView加入鼠标滑过的高亮效果和单击行颜色改变
- 鼠标经过GridView的行会改变行颜色,离开后恢复原来的颜色
- gridview中鼠标都改变颜色
- 鼠标经过GridView的行改变行颜色
- repeater单双行颜色不同,gridview repeater DataList 鼠标经过改变背景颜色
- GridView鼠标经过时颜色改变
- gridview 鼠标经过改变颜色
- gridview repeater DataList 鼠标经过改变背景颜色
- Asp.Net中GridView加入鼠标滑过的高亮效果和单击行颜色改变