protected void grvemployee_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//this will be DataKey of the row
int employeeId = (int)grvemployee.DataKeys[e.Row.RowIndex].Value;
if (Session["EmployeeIds"] != null)
{
// get the arraylist from the session values
employeeIds = (ArrayList)Session["EmployeeIds"];
if (employeeIds != null)
{
//If the DataKey is in the arraylist then change the row color.
if (employeeIds.Contains(employeeId))
{
e.Row.BackColor = System.Drawing.Color.Red;
e.Row.Style.Add(HtmlTextWriterStyle.FontWeight, "Bold");
}
}
}
}
}
refer
http://forums.asp.net/t/1679174.aspx/1?making+the+grid+row+bold+whenever+user+clicks+on+linkbutton
http://stackoverflow.com/questions/2073404/how-to-make-row-in-gridview-bold-and-regular-programatically-in-c-3-5