protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#d3d7d4'"); //鼠标移进
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor"); //鼠标移出
e.Row.Attributes.Add("onclick", "if(window.oldtr!=null){window.oldtr.runtimeStyle.cssText='';}this.runtimeStyle.cssText='background-color:#d3d7d4';window.oldtr=this"); //点击行
}
}