鼠标放到哪一行,哪一行颜色发生变化

来源:互联网 发布:初级程序员工作内容 编辑:程序博客网 时间:2024/04/28 11:45
protected void GridView2_RowDataBound1(object sender, GridViewRowEventArgs e)    {        if (e.Row.RowType==DataControlRowType.DataRow)        {            //当鼠标在某一行上方时激发            e.Row.Attributes.Add("onmouseover", "curColor=this.style.backgroundColor;this.style.backgroundColor='#D9B3B3'");            //当鼠标从某一行上方移开时激发            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=curColor");        }    }