title: Checkbox within a datagrid, findcontrol issue
body: <p>Keep in mind that for this I am limited to using ASP .NET 1.1, as for this environment I cannot upgrade to 2.0 or beyond</p>
  
  <p>Essentially, I have a very simple datagrid that has a checkbox in one of the columns, which is a template column...the code for the datagrid is this:</p>
  
  <pre><code>   &lt;asp:datagrid id="dgDates" OnItemCommand="gridEventHandler" BorderColor="Black" BorderWidth="1px"
      CellPadding="3" runat="server" AutoGenerateColumns="False" HorizontalAlign="Left" AllowSorting="True"
      OnSortCommand="SortData" OnItemDataBound="gridItemDataBound"&gt;
      &lt;HeaderStyle Font-Underline="True" Font-Bold="True" HorizontalAlign="Center" ForeColor="Black"
       BackColor="#D4D0C8"&gt;&lt;/HeaderStyle&gt;
      &lt;Columns&gt;
       &lt;asp:BoundColumn DataField="strParameterName" SortExpression="strParameterName" HeaderText="Parameter Name"&gt;&lt;/asp:BoundColumn&gt;
       &lt;asp:BoundColumn DataField="dtParameterValue" SortExpression="dtParameterValue" HeaderText="Parameter Value"&gt;&lt;/asp:BoundColumn&gt;
       &lt;asp:TemplateColumn HeaderText="Status" SortExpression="blnStatic"&gt;
        &lt;ItemTemplate&gt;
         &lt;asp:CheckBox ID="cbStaticRolling" OnCheckedChanged="staticRolling_CheckedChanged" Runat="server" AutoPostBack="true"&gt;&lt;/asp:CheckBox&gt;           
  
        &lt;/ItemTemplate&gt;
       &lt;/asp:TemplateColumn&gt;
      &lt;/Columns&gt;
     &lt;/asp:datagrid&gt;
  </code></pre>
  
  <p>Now, I want to evaluate a stored proc based on whether a checkbox for a particular row is set to true or not, so I have this as an eventhandler for the datagrid:</p>
  
  <pre><code>    Protected Sub gridItemDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
          If IsPostBack Then
              Dim intRptSchedulingDatesID As Integer
  
              If (e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem) Then
                  cbStaticRolling = CType(e.Item.FindControl("cbStaticRolling"), CheckBox)
  
                  intRptSchedulingDatesID = CType(e.Item.DataItem, System.Data.DataRowView).Item("intRptSchedulingDatesID")
                  If cbStaticRolling.Checked Then
                      SqlHelper.ExecuteNonQuery(ConfigurationSettings.AppSettings(Web.Global.CfgKeyConnStringADMIN), "dbo.spRptSchedulingDate_update", intRptSchedulingDatesID, True)
                  ElseIf Not cbStaticRolling.Checked Then
                      SqlHelper.ExecuteNonQuery(ConfigurationSettings.AppSettings(Web.Global.CfgKeyConnStringADMIN), "dbo.spRptSchedulingDate_update", intRptSchedulingDatesID, False)
                  End If
              End If
          End If
      End Sub
  </code></pre>
  
  <p>Now, my issue is that when I set cbStaticRolling to the CheckBox control through FindControl on the e argument, it seems to set the variable okay, but doesn't seem to be setting the right one, or setting it properly, because "Checked" property is false regardless of whether I check the box or not</p>