title: GridView Checkbox - Cannot Change Properties
body: <p>I have an ASP GridView with a column that contains CheckBox controls.  These CheckBoxes are bound to a bit field accessed via a SqlDataSource.  The GridView is editable and the CheckBoxes are disabled on load.
  I am trying to get the enabled property to change to true during edit, so the CheckBox in the row that is being edited can be changed, and this change updated to the bit field in the database.</p>
  
  <p>The ASP code</p>
  
  <pre><code>            &lt;asp:UpdatePanel ID="upGridView" runat="server" UpdateMode="Conditional"&gt;
              &lt;ContentTemplate&gt;
              &lt;asp:GridView ID="gvChecklist" runat="server" 
                      AutoGenerateColumns="false" DataSourceID="dsChecklist" 
                      AutoGenerateEditButton="true" onrowupdating="gvChecklist_RowUpdating" 
                      onrowediting="gvChecklist_RowEditing"&gt;
                  &lt;Columns&gt;
                      &lt;asp:TemplateField HeaderText="Finished"&gt;
                          &lt;ItemTemplate&gt;&lt;asp:CheckBox ID="cbFinished" runat="server" Enabled="false" Checked='&lt;%# Eval("Finished") ?? false %&gt;' /&gt; &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:BoundField DataField="Division" 
                              HeaderText="Division"
                              readonly="true" /&gt;
                      &lt;asp:BoundField DataField="Application"
                              HeaderText="Application"
                              readonly="true" /&gt;
                      &lt;asp:BoundField DataField="Task"
                              HeaderText="Task"
                              readonly="true" /&gt;
                      &lt;asp:BoundField DataField="TestedBy" HeaderText="Tested By" readonly="true"/&gt;
                      &lt;asp:BoundField DataField="Notes" HeaderText="Notes" ReadOnly="false"/&gt;
                      &lt;asp:BoundField DataField="JiraTicket"
                              HeaderText="JIRA Ticket"
                              readonly="false" /&gt;
                  &lt;/Columns&gt;
              &lt;/asp:GridView&gt;
              &lt;/ContentTemplate&gt;
              &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>C# Code Behind for the RowEditing event</p>
  
  <pre><code>protected void gvChecklist_RowEditing(object sender, GridViewEditEventArgs e)
  {
      GridView gvChecklist = (GridView)LoginView1.FindControl("gvChecklist");
      CheckBox cb = (CheckBox)gvChecklist.Rows[e.NewEditIndex].Cells[1].FindControl("cbFinished");
  
      cb.Enabled = true;
      gvChecklist.DataBind();
  }
  </code></pre>
  
  <p>-edit: I felt the need to add a little more information here.  The code to set the CheckBox cb to the GridView Row's CheckBox seems to be working correctly, as I can see the enabled property = true through the debugger.  I am wondering if it is getting set back to false due to PostBack after this event runs.  The Load method for this page is empty, but I am thinking that the enabled=false code is being hit in the ASP page.</p>
  
  <p>UI of GridView
  <img src="https://i.stack.imgur.com/eVR1z.png" alt="enter image description here"></p>