GridView行背景色改变效果

          protected void gvTestReportOSimple_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowIndex > -1)
            {
  ////当鼠标停留时更改背景色
                //e.Row.Attributes.Add("onmouseover",   "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF'");
                ////当鼠标移开时还原背景色
                //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}

原文地址:https://www.cnblogs.com/Liao/p/2158377.html