Either we can write code on Gridview Rowcreated event or RowDataBound event.
protected void project_grid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//Highlight Row on Mouse over event
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#F0D8D8'");
//On Mouse out event restore girdview row color based on alternate row color
if (e.Row.RowIndex % 2 == 0)
{
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#F5F5DC'");
}
else
{
//Reset Row Color(White Color)
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
}
}
}