add below code, and please note its not tested some correction will require
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
String statusVal = HttpUtility.HtmlDecode(e.Row.Cells[ColumnIndex].Text).Trim();
if(statusVal =="Pass")
{
foreach (TableCell cell in e.Row.Cells) {
cell.BackColor = Color.Yellow;
}
{
if(statusVal =="Fail")
{
foreach (TableCell cell in e.Row.Cells) {
cell.BackColor = Color.Red;
}
{
}
}