首先为GridView添加RowDataBound事件
在事件里面写入如下代码:
if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#F0FAFF'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=''"); }
首先为GridView添加RowDataBound事件
在事件里面写入如下代码:
if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#F0FAFF'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=''"); }