GridView鼠标移动行变色

第一种方法

GridView的

Code
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)   
    {   
        
if (e.Row.RowType == DataControlRowType.DataRow)   
        {   
            e.Row.Attributes.Add(
"onMouseOver""SetNewColor(this);");   
            e.Row.Attributes.Add(
"onMouseOut""SetOldColor(this);");   
        }   
    }   

在页面中加入

Code

方法二: 

Code

页面加入:

Code

方法三:

 

Code
posted @ 2009-04-25 22:24  不想睡觉  阅读(338)  评论(0)    收藏  举报