title: .NET checkbox.Checked always return false
body: <p>i'm a newby at .NET and I'm having a problem with my checkboxes. They all return false, even if they are selected. Here is my asp code    </p>
  
  <pre><code>   &lt;asp:GridView ID="gvGeneros1" runat="server" class="divTable" 
          AutoGenerateColumns="False" DataKeyNames="idgenero" CssClass="table"&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField DataField="nome" HeaderText="Gênero" SortExpression="nome" &gt;
              &lt;ControlStyle Width="200px" /&gt;
              &lt;ItemStyle Width="200px" /&gt;
              &lt;/asp:BoundField&gt;
              &lt;asp:TemplateField AccessibleHeaderText="Check"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:CheckBox ID="checkGenero" runat="server" /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>and here's my c# code</p>
  
  <pre><code>DataSet dsDivided;
  
  protected void Page_Load(object sender, EventArgs e)
  {
      Music musicbll = new Music();
      DataSet dsGeneros = musicbll.getGenders();
  
      int size = dsGeneros.Tables[0].Rows.Count;
       dsDivided = null;
  
          // Divide in two DataTable
          dsDivided = Tools.SplitDataTableInTwo((DataTable)dsGeneros.Tables[0], size / 2);
  
      gvGeneros1.DataSource = dsDivided.Tables["FirstSet"];
      gvGeneros1.DataBind();
  
      for (int i = 0; i &lt; gvGeneros1.Rows.Count; i++)
      {
          ((CheckBox)gvGeneros1.Rows[i].Cells[1].Controls[1]).Checked=false;
      }
  
  }
  
  
  protected void btGravarPrefs_Click(object sender, EventArgs e)
  {
      DataTable dt = new DataTable("generos");
      dt.Columns.Add("idgenero", typeof(int));
      dt.Columns.Add("active", typeof(bool));
  
      for (int i = 0; i &lt; gvGeneros1.Rows.Count; i++)
      {
          int idCliente = (int)dsDivided.Tables[0].Rows[i][0];
           bool check = ((CheckBox)gvGeneros1.Rows[i].Cells[1].Controls[1]).Checked; //always false
          dt.Rows.Add(new object[] { idCliente, check});
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I don't know what to try more, and i search all over and it seems right. Thanks</p>