说明:这里所谓的鼠标动作指的是,当鼠标经过某一行的时候,该行的颜色发生变化。
protected void GridView1_RowCreated(object sender,GridViewRowEventArgs e)
{
if(e.Row.RowType==DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='#00fee';");
e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=c;");
}
}