鼠标停留在GridView某一行时 行的颜色改变
2008-07-29 14:36
295 查看
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'");
}
}
---------------------------------------------
可以选择GRIDVIEW控件,然后双击RowDataBound事件
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'");
}
}
---------------------------------------------
可以选择GRIDVIEW控件,然后双击RowDataBound事件
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鼠标经过某行改变样式、颜色并且单击弹出窗口
- 实现DataGrid的某一行随着鼠标的移入移出而改变颜色
- gridview鼠标经过改变行颜色(高亮)
- GRIDVIEW 鼠标经过改变背景颜色
- Asp.Net中GridView加入鼠标滑过的高亮效果和单击行颜色改变
- datagrid每一行都会随着鼠标的动作改变颜色
- 鼠标移到GridView某一行时改变该行的背景色方法
- GridView中点击CheckBox选中一行来改变此行的颜色
- winform中GridView控件在选中一行后改变选中行的背景颜色
- GridView鼠标移动到某一行时行发生变色和为Gridview中编辑模板中的控件添加颜色