title: C# if statement skipped even if condition is met
body: <p>im writing a basic program on c# for school and im having trouble with an if statement where the condition gets met but the code gets skipped as if the condition wasn't met.</p>
  
  <pre><code>//this runs when i select a cell on the dataGridView
  private void dataGridView1_CellClick(object sender,DataGridViewCellEventArgs e)
  {    
  
      string estado = "";
      if (e.RowIndex &gt;= 0)
      {
          DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
          id_lbl.Text = row.Cells[0].Value.ToString();
          nombre_lbl.Text = row.Cells[1].Value.ToString();
          apellido_lbl.Text = row.Cells[2].Value.ToString();
          estado = row.Cells[7].Value.ToString();
      }
  
      id_lbl.Visible = true;
      nombre_lbl.Visible = true;
      apellido_lbl.Visible = true;
  
      if(estado == "Activo")
      {
          baja_btn.Enabled = true;
      }
      else if (estado == "NoActivo")
      {
          alta_btn.Enabled = true;
      }
      else
      {
          MessageBox.Show(estado);
      }
  }
  </code></pre>
  
  <p>code runs but if statement jumps directly to else code and message box displays Activo, how ever, <code>baja_btn.Enabled = true;</code> does not run.
  same is true if i select row with NoActivo. if jumps straight to else...</p>
  
  <p>Note: the ACTUAL value of estado just before entering the if statement is Activo. so as it is it SHOULD go into the first condition but it skips all the way to else..</p>