ForeColor in Gridview column

1

I have a condition on the page load of my page to disable a LinkButton and change the color of the letter. The Enabled attribute works but ForeColor does not, here's my code:

if (!Page.IsPostBack)
{
    LlenarGridview(GridView1_Persona, Datos);
    foreach (GridViewRow row in GridView1_Persona.Rows)
    {
         if (row.RowType == DataControlRowType.DataRow)
         {
              if (row.Cells[2].Text == "Aprobado")
              {
                   row.Cells[3].Enabled = false;
                   row.Cells[3].ForeColor=Color.Gray;
              }else
              {
                   row.Cells[3].ForeColor = Color.Green;
              }
         }
    }
}
    
asked by Kattyleja Jaramillo 12.03.2018 в 01:32
source

0 answers