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
9 }
10
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
9 }
10