title: Check a CheckBoxField from code behind file
body: <p>It seems CheckBoxField won't accept an ID property, so I can't directly call the component in the code behind file.</p>
  
  <pre><code>&lt;asp:DetailsView ID="dv" runat="server" AutoGenerateRows="False" 
      DataKeyNames="ID" DataSourceID="ds" DefaultMode="Insert" 
      OnItemInserting="dv_ItemInserting" OnItemInserted="dv_ItemInserted"
      OnItemUpdated="dv_ItemUpdated" OnItemCommand="dv_ItemCommand" 
      EnableModelValidation="True"&gt;
      &lt;Fields&gt;
          &lt;asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="false" ReadOnly="True" SortExpression="ID" /&gt;
          &lt;asp:CheckBoxField ID="chkMidmarket" DataField="Midmarket_Flag" HeaderText="Midmarket" SortExpression="Midmarket_Flag" runat="server" /&gt;
          ...
      &lt;/Fields&gt;
  &lt;/asp:DetailsView&gt;
  </code></pre>
  
  <p>How would I check the checkbox from the code behind file?</p>