title: Return Gridview Checkbox boolean
body: <p>I've racked my brains on trying to access the ID column of a gridview where a user selects a checkbox:</p>
  
  <pre><code>&lt;asp:GridView ID="gvUserFiles" runat="server"&gt;
              &lt;Columns&gt;
              &lt;asp:TemplateField HeaderText="Select" ItemStyle-HorizontalAlign="Center" &gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:CheckBox  ID="chkSelect" runat="server" /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>The gridview columns are chkSelect (checkbox), Id, fileName, CreateDate</p>
  
  <p>When a user checks a checkbox, and presses a button, i want to receive the "id" column value.</p>
  
  <p>Here is my code for the button:</p>
  
  <pre><code>foreach (GridViewRow row in gvUserFiles.Rows)
              {
                  var test1 = row.Cells[0].FindControl("chkSelect");
                  CheckBox cb = (CheckBox)(row.Cells[0].FindControl("chkSelect"));
                  //chk = (CheckBox)(rowItem.Cells[0].FindControl("chk1"));  
                  if (cb != null &amp;&amp; cb.Checked)
                  {
                      bool test = true;
  
                  }
              }
  </code></pre>
  
  <p>The cb.checked always is returned false.</p>