心语飘絮
别让今天的懒惰成为明天的遗憾!!!
1 protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
2     {
3         if (e.Row.RowType == DataControlRowType.DataRow )
4         {
5             e.Row.Attributes.Add("onmouseover""currentcolor=this.style.backgroundColor;this.style.backgroundColor='#C0C0FF';this.style.cursor='hand';");
6             //当鼠标移走时还原该行的背景色
7             e.Row.Attributes.Add("onmouseout""this.style.backgroundColor=currentcolor");
8         }
9     }

其中currentcolor=this.style.backgroundColor;最为重要!!!
posted on 2007-03-12 19:01  jeffery0101  阅读(531)  评论(2编辑  收藏  举报