GridView行,指向时变色

来源:互联网 发布:数据库安全审计 编辑:程序博客网 时间:2024/06/06 05:06
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)        {            //如果当前行尾数据行            if (e.Row.RowType == DataControlRowType.DataRow)            {                //添加鼠标在当前行时的background-color属性                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#EFF8FF';");                //鼠标离开当前行后                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");            }        }

0 0
原创粉丝点击