title: Adding a checkbox column to asp.net gridview
body: <p>I have a couple questions when it pertains to adding a <code>CheckBox</code> column to <code>gridview</code> in <code>asp.net</code> and getting multiple values. First off I see everyone adding <code>OnCheckedChanged="chkview_CheckedChanged"</code> to their <code>aspx</code> page but when you click on the <code>CheckBox</code> to set its actions it does not open <code>OnCheckedChanged="chkview_CheckedChanged"</code>. It opens <code>SelectedIndexChanged</code> event instead. What I am trying to do is when they select a <code>CheckBox</code> it adds the corresponding rows info to the <code>TextBox</code>. Here is what I am currently using to set the values. How can I use a selected <code>CheckBox</code>  instead?</p>
  
  <pre><code>protected void dropGridView_SelectedIndexChanged1(object sender, EventArgs e)
  {
      GridViewRow row = dropdeadGridView.SelectedRow;
      IDTextBox.Text = row.Cells[1].Text;
      loadnumTextBox.Text = row.Cells[2].Text;
  }
  </code></pre>
  
  <p>Once done with that how can you make it to where it will get every row that is checked instead of just one which is what is my current problem. I am looking for a way to select multiple rows and have a select button. I have done a lot of looking and can find nothing on it so I am trying to accomplish this with <code>CheckBoxes</code> instead. Any ideas how I can add this and get the multiple rows that can be selected. Thank you in advance.</p>
  
  <p>Here is my edit* Posting asp code for <code>CheckBox</code> column:</p>
  
  <pre><code>&lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox ID="SelectCheckBox" runat="server" OnCheckedChanged="SelectCheckBox_OnCheckedChanged"/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
  </code></pre>