1
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
2
{
3
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#FFC0C0'");
4
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
5
//注意,这里是backgroundColor, 不要写成 backcolor 和 backgroudcolor(注意大小写)
6
//e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#FFC0C0'");
7
//e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
8![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
9
}
10![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)