title: CheckBox "Checked" value in GridView is always false
body: <p>I'm using a <code>checkbox</code> column in a <code>gridview</code> which is populated from a <code>SQL</code> database. A button below the <code>gridview</code> should retrieve the data of the rows whose <code>checkboxe's</code> have been checked. When I loop over all the rows <code>checkboxe's</code>, none of them has <code>checked==true</code> even though I have checked them all before clicking the button. Here is the <code>ASP.NET</code> code:</p>
  
  <pre><code>&lt;asp:TemplateField&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:CheckBox ID="chkRow" runat="server" /&gt;
          &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>and here is the button's action that loops over all the rows' checkboxes:</p>
  
  <pre><code>protected void GetSelectedRecords(object sender, EventArgs e)
  {
      foreach (GridViewRow row in GridView1.Rows)
      {
          if (row.RowType == DataControlRowType.DataRow)
          {
              CheckBox chkRow = (row.Cells[0].FindControl("chkRow") as CheckBox);               
              if (chkRow != null &amp;&amp; chkRow.Checked) //chkRow.Checked is always "false" 
              {
                  string name = row.Cells[2].Text;
              }
          }  
       }              
  }
  </code></pre>
  
  <p>Thanks a lot in advance. I'd greatly appreciate any help.</p>