You have to write the below code on OnRowDataBound event.
Code
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string id = e.Row.Cells[0].Text.Substring(0, 1);
if (id.ToLower() == "a")
{
e.Row.BackColor = Color.Red;
e.Row.BorderWidth = 5;
}
}
}