title: How to get a column of checkboxes in Gridview?
body: <p>One note is that I'm doing this all in Visual Studio 2013 Express for Web.</p>
  
  <p>I have a GridView, and its data is being generated by a SqlDataSource. Currently, when I test the page. A table like below gets generated:</p>
  
  <pre><code>CustomerID    CustomerName    CustomerAddress
  -----------   ------------    ----------------
  1             Bob             Address
  2             John            Address
  3             Smith           Address
  </code></pre>
  
  <p>However, I really want this:</p>
  
  <pre><code>CustomerID    CustomerName    CustomerAddress
  -----------   ------------    ----------------
  []             Bob             Address
  []             John            Address
  []             Smith           Address
  </code></pre>
  
  <p>I want the CustomerID field to be "hidden field" and have a checkbox in its place. Then, I want the value of the checkboxes to be the CustomerID for that row. However, I can't for the life of me get the checkboxes in there, and it's still just displaying the CustomerID itself. In the end, I want to create a button that will delete the rows of whatever is checked, and have it reflected in the database via a <code>DELETE FROM TABLE</code>. This is why I want the checkboxes to also "have" a value of whatever the CustomerID is for that particular row.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="RowsInGroup" &gt;
              &lt;Columns&gt;
                  &lt;asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" /&gt;
                  &lt;asp:BoundField DataField="CustomerName" HeaderText="CustomerName" SortExpression="CustomerName" /&gt;
                  &lt;asp:BoundField DataField="CustomerAddress" HeaderText="CustomerAddress" SortExpression="CustomerAddress" /&gt;
                  &lt;asp:TemplateField&gt;&lt;/asp:TemplateField&gt;
              &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>If there's a better Data object to use in the Toolbox, I'm all ears.</p>
  
  <p>Thanks for any advice you can provide!</p>