title: Add checkbox column to asp.net gridview programmatically
body: <p>I am loading data to gridview from a stored procedure, what I want is to include a checkbox in the gridview programmatically, I was able to get that through this link <a href="https://stackoverflow.com/questions/5412638/adding-all-rows-checkbox-for-unknown-gridview-data-source">Adding All Rows Checkbox for Unknown Gridview Data Source</a></p>
  
  <p><strong>stored pro portion to include the checkbox</strong></p>
  
  <pre><code>select 
     fields...
     'chkApprove' = 0x1
  from 
     tablename
  </code></pre>
  
  <p><strong>gridview defintion in source view asp.net</strong></p>
  
  <pre><code> &lt;asp:GridView ID="grdDSTR" runat="server" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None"
                           BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical"  Font-Size="Smaller" 
                          EmptyDataText="No Records Found" ShowHeaderWhenEmpty="True" width="100%" AutoGenerateColumns="false"&gt;
  
  
        &lt;Columns&gt;
       &lt;asp:BoundField HeaderText="Name" DataField="Name" /&gt;
       &lt;asp:BoundField HeaderText="Date" DataField="Date" /&gt;
       &lt;asp:BoundField HeaderText="Day" DataField="Day" /&gt;
       &lt;asp:BoundField HeaderText="Surcharge" DataField="Surcharge" /&gt;
       &lt;asp:BoundField HeaderText="Senior" DataField="Senior" /&gt;
       &lt;asp:BoundField HeaderText="VES" DataField="VES" /&gt;
       &lt;asp:BoundField HeaderText="Other" DataField="Other" /&gt;
       &lt;asp:BoundField HeaderText="Refund" DataField="Refund" /&gt;
       &lt;asp:BoundField HeaderText="Void" DataField="Void" /&gt;
        &lt;asp:BoundField HeaderText="GSC" DataField="GSC" /&gt;
       &lt;asp:BoundField HeaderText="Cash" DataField="Cash" /&gt;
       &lt;asp:BoundField HeaderText="Charge" DataField="Charge" /&gt;
       &lt;asp:BoundField HeaderText="Gift" DataField="Gift" /&gt;
      &lt;asp:CheckBoxField DataField="chkApprove" HeaderText="Approve" /&gt;    
  </code></pre>
  
  <p>What I noticed is that, the checkboxes per row are disabled, and all are automatically checked by default. </p>
  
  <p>My desired output is only rows who match a condition in the row computation should be checked. How can I create a simple condition like for example when GSC data is above 10,000, the checkbox should be checked? otherwise, leave it unchecked</p>
  
  <p><img src="https://i.stack.imgur.com/XQZUi.jpg" alt="enter image description here"></p>