void GridView1_RowDataBound protected (Object SENDER, GridViewRowEventArgs E)
{
// adapted mouse after color
if (e.Row.RowType == DataControlRowType.DataRow) // determines whether the current row of the line type datarow
{
// When the mouse put up when the first save background color of the current line and attached to a color
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='yellow',this.style.fontWeight='';");
// When the mouse leaves the background color to restore the previous color
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
}
//单击行改变行背景颜色
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "this.style.backgroundColor='#99cc00'; this.style.color='buttontext';this.style.cursor='default';");
}
}