gridview 点击行变颜色

来源:互联网 发布:淘宝刷单怎么被发现 编辑:程序博客网 时间:2024/03/29 05:06

 if (e.Row.RowType == DataControlRowType.DataRow)
        {

            //当鼠标移到的时候设置该行颜色为"", 并保存原来的背景颜色
            e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#FFE8FF'");
            //当鼠标移走时还原该行的背景色
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");


          


        }

0 0
原创粉丝点击