protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("OnClick", "this.style.backgroundColor='Red'");
}
}被单击的数据 显示高亮单击另一条数据时 原来显示高亮的恢复原来的颜色.怎样实现?
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("OnClick", "this.style.backgroundColor='Red'");
}
}被单击的数据 显示高亮单击另一条数据时 原来显示高亮的恢复原来的颜色.怎样实现?
解决方案 »
- ASP.NET如何生成带图片的WORD文档?
- 大牛们帮忙看看 我这个判断语句哪错了?3QQ
- table预览格式的问题
- 问个数据库问题5555555555
- 关于两个CheckBoxList选项关联问题.急.在线等
- 求一简单的正则表达式问题!
- 老衲需求JQuery怎么判断text里面的值什么的答案?
- ASP.NET 中怎么中延长时间.急急急急!!!!
- 请问下面这句在C#里好用,但在VB.NET不好用,应该怎么改呀!简单!
- 各位用过windows server2003+Vs.net 2003的朋友进来谈谈使用后的感觉吧
- <%=str%> 可以输出后台的变量,如果是js变量想输出如何办 ,比如var str=
- 关于获取gridview中checkbox选中行某一列的值的问题
e.Row.Attributes.Add("onblur", "this.style.backgroundColor='???'"); 其他鼠标事件:
onmousedown 当用户用任何鼠标按钮单击对象时触发。onmouseenter 当用户将鼠标指针移动到对象内时触发。onmouseleave 当用户将鼠标指针移出对象边界时触发。onmousemove 当用户将鼠标划过对象时触发。onmouseout 当用户将鼠标指针移出对象边界时触发。onmouseover 当用户将鼠标指针移动到对象内时触发。onmouseup 当用户在鼠标位于对象之上时释放鼠标按钮时触发。onmousewheel 当鼠标滚轮按钮旋转时触发。onmove 当对象移动时触发。onmoveend 当对象停止移动时触发。onmovestart 当对象开始移动时触发。试试
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["style"] = "Cursor:hand "; //鼠标变成手
e.Row.Attributes.Add("onmouseover ", "currentcolor=this.style.backgroundColor;this.style.backgroundColor= '#C0C0FF ';this.style.cursor= 'hand '; ");
//当鼠标移走时还原该行的背景色
e.Row.Attributes.Add("onmouseout ", "this.style.backgroundColor=currentcolor ");
//选择任意处都选择
e.Row.Attributes.Add("onclick", "javascirpt:__doPostBack('gvItem','Select$" + e.Row.RowIndex + "')");
}
}
和鼠标移出事进 改className回来
我需要的是单击时间 OnMouseOut和OnMouseOver效果不好
e.Row.Attributes.Add("onblur", "this.style.backgroundColor=''"); //空值就是原来的底色e.Row.Attributes.Add("OnClick", "this.style.backgroundColor='Red'");
var lastRow="";
function row_click(row)
{
row.style.backgroundColor='Red';
if(lastRow !="")
{
lastRow.style.backgroundColor='';
}
lastRow = row;
}
这样也肯定OK!
这个事件 怎样才能触发,我选择另外一条数据 触发不了
这个事件 怎样才能触发,我选择另外一条数据 触发不了
求救啊