Controls in TemplateFields not displaying in GridView
<p>I have a gridview with one boundfield that is filled in the code-behind after the user makes some selections from a dropdown.  This is filled fine, but I also have two other columns with checkboxes in TemplateFields.  These are never displayed in this gridview.
Here's the aspx:</p>

<pre><code>&lt;asp:UpdatePanel ID="clientServerUpdatePanel" runat="server"&gt;
        &lt;ContentTemplate&gt;
            &lt;asp:GridView ID="clientServerGridView" runat="server" AutoGenerateColumns="False"&gt;
                &lt;Columns&gt;
                    &lt;asp:BoundField HeaderText="Operating System" DataField="OS" /&gt;
                    &lt;asp:TemplateField HeaderText="Client" &gt;
                        &lt;asp:ItemTemplate&gt;
                            &lt;asp:CheckBox runat="server" ID="clientCheckBox" Checked="false" /&gt;
                        &lt;/asp:ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
                    &lt;asp:TemplateField HeaderText="Server"&gt;
                        &lt;asp:ItemTemplate&gt;
                            &lt;asp:Checkbox runat="server" ID="serverCheckBox" Checked="false" /&gt;
                        &lt;/asp:ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
                &lt;/Columns&gt;
            &lt;/asp:GridView&gt;
        &lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;
</code></pre>

<p>Here's the relavent code-behind which is placed in a click event handler:</p>

<pre><code>Dim dt As DataTable = New DataTable()
dt.Columns.Add(New DataColumn("OS", System.Type.GetType("System.String")))

For Each OSItem As ListItem In Me.defaultOSesListBox.Items
    If Not OSItem.Selected Then
        Continue For
    End If

    Dim dr As DataRow = dt.NewRow()
    Dim os As String = OSItem.Text
    dr("OS") = os
    dt.Rows.Add(dr)
Next

Me.clientServerGridView.DataSource = dt
Me.clientServerGridView.DataBind()
</code></pre>

<p>Does anyone have an idea what the root of my problem is?</p>

<p>EDIT:  I needed to have the checkboxes wrapped in</p>

<pre><code>&lt;ItemTemplate&gt;
</code></pre>

<p>instead of </p>

<pre><code>&lt;asp:ItemTemplate&gt;
</code></pre>
