在web页面中的gridview里设置鼠标

来源:互联网 发布:nginx 静态图片服务器 编辑:程序博客网 时间:2024/05/29 18:23

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //鼠标移动时行变色。                                                                        
            e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor, this.style.backgroundColor='#cdd1a4'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");

            //设置悬浮鼠标指针形状为"小手"
            e.Row.Attributes["style"] = "Cursor:hand";
        }
    }

原创粉丝点击