GRIDVIEW 鼠标经过改变背景颜色

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)  
    {  
        if (e.Row.RowType == DataControlRowType.DataRow) //判断是否是DataRow,以防止鼠标经过Header也有效果  
        {  
            e.Row.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#cccccc'");  
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=e");  
        }  
    }
原文地址:https://www.cnblogs.com/cosiray/p/1551908.html