GridView1_RowDataBound

来源:互联网 发布:天津市教研网络平台 编辑:程序博客网 时间:2024/06/07 21:39
if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "defaultColor=this.style.background;this.style.backgroundColor='Red';this.style.cursor='hand';");//当鼠标停留时背景色
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=defaultColor;");//当鼠标移开时还原背景色
}