Friday, September 18, 2009

Highlighting Rows in a GridView

protected void GridView1_RowDataBound ( object sender, GridViewRowEventArgs e )
{
if ( e.Row.RowType == DataControlRowType.DataRow )
{
e.Row.Attributes.Add ( "onmouseover", "this.savedColor=this.style.backgroundColor;this.style.backgroundColor='Yellow'" );
e.Row.Attributes.Add ( "onmouseout", "this.style.backgroundColor=this.savedColor;" );
}
}

No comments:

Post a Comment