title: Unknown Control Error with CollapsiblePanelExtender in a gridview
body: <p>I'm in the process of troubleshooting a coding challenge in a gridview where I'm attempting to insert a CollapsiblePanelExtender from the Ajax Control Toolkit (in Visual Studio 2012) into a section of checkboxes.  What I'm hoping to do is to make the entire section of checkboxes collapse and expand at the users request.  </p>
  
  <p>The challenge I'm facing (the asp code is below - no cs code) is that in the " &lt; asp:Panel ID="pnlClick"..." portion of the code there is a green squiggly line below 'Panel' and under every instance of 'CheckBoxField' with the following errors (as noted from the debug output):</p>
  
  <pre><code>Element 'Panel' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
  
  Element 'CheckBoxField' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
  </code></pre>
  
  <p>Also, when I switch to the design view of this page I get the following error:</p>
  
  <pre><code>Error Creating Control - GridView1
  
  System.Web.UI.WebControls.DataControlFieldCollection must have items of type 'System.Web.UI.WebControlField'.  'asp:Panel' is of type 'System.Web.UI.WebControls.Panel'.
  </code></pre>
  
  <p>The SQL portion of this puzzle is rock solid so I don't need assitance with this.  I'm new to the Ajax Control Toolkit so I'm trying to determine what exactly I need to tweak to make this work (if this is even the right solution for what I'm attempting to accomplish).  I've been pouring through Google for answers but nothing has helped me to resolve this matter with a gridview.  The code below is the product of trying to piece together other non gridview solutions within the past six months to a year.  There's something I'm probably missing and I'm willing to bet this is probably something simple that needs to be fixed.  What am I missing here (below) if this is even possible?</p>
  
  <p>If anyone also knows of a good non-msdn reference with examples that would be greatly appreciated too. </p>
  
  <p>Aspx code:</p>
  
  <pre><code>&lt;%@ Page Title="Test Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="form2.aspx.cs" Inherits="form2" %&gt;
  
  &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
  
  
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" Runat="Server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server"&gt;
      &lt;cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"&gt;&lt;/cc1:ToolkitScriptManager&gt; 
      &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"&gt;
          &lt;AlternatingRowStyle BackColor="White" /&gt;
          &lt;Columns&gt;
              &lt;asp:CommandField ShowEditButton="True" /&gt;
              &lt;asp:BoundField DataField="Field 1" HeaderText="Field 1" SortExpression="Field 1" /&gt;
              &lt;asp:BoundField DataField="Field 2" HeaderText="Field 2" SortExpression="Field 2" /&gt;
              &lt;asp:BoundField DataField="Field 3" HeaderText="Field 3" SortExpression="Field 3" /&gt;
              &lt;asp:BoundField DataField="Field 4" HeaderText="Field 4" SortExpression="Field 4" /&gt;
              &lt;asp:BoundField DataField="Field 5" HeaderText="Field 5" SortExpression="Field 5" /&gt;
              &lt;asp:BoundField DataField="Field 6" HeaderText="Field 6" SortExpression="Field 6" /&gt;
              &lt;asp:BoundField DataField="Field 7" HeaderText="Field 7" SortExpression="Field 7" /&gt;
              &lt;asp:BoundField DataField="Field 8" HeaderText="Field 8" SortExpression="Field 8" /&gt;
              &lt;asp:BoundField DataField="Field 9" HeaderText="Field 9" SortExpression="Field 9" /&gt;
            &lt;asp:Panel ID="pnlClick" runat="server" CssClass="collapsiblepanelCSS"&gt;
                &lt;div style="background-color:blue;height:30px; vertical-align: middle"&gt;
                    &lt;div style="float: left;color:white;padding: 5px 5px 0 0 "&gt;
                        Server List Collapsable Panel
                    &lt;/div&gt;
                    &lt;div style="float: right; color: white; padding: 5px 5px 0 0" id="divshow"&gt;
                        &lt;asp:Label ID="lblMessage" runat="server" Text="Label" /&gt;
                        &lt;/div&gt;
                    &lt;div style="clear:both"&gt;
                  &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/asp:Panel&gt;
              &lt;asp:Panel ID="pnlCollapsable" runat="server" Height="0" CssClass="collapsiblepanelCSS"&gt;
              &lt;asp:CheckBoxField DataField="Check Box 1" HeaderText="Check Box 1" SortExpression="Check Box 1" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 2" HeaderText="Check Box 2" SortExpression="Check Box 2" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 3" HeaderText="Check Box 3" SortExpression="Check Box 3" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 4" HeaderText="Check Box 4" SortExpression="Check Box 4" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 5" HeaderText="Check Box 5" SortExpression="Check Box 5" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 6" HeaderText="Check Box 6" SortExpression="Check Box 6" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 7" HeaderText="Check Box 7" SortExpression="Check Box 7" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 8" HeaderText="Check Box 8" SortExpression="Check Box 8" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 9" HeaderText="Check Box 9" SortExpression="Check Box 9" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 10" HeaderText="Check Box 10" SortExpression="Check Box 10" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 11" HeaderText="Check Box 11" SortExpression="Check Box 11" /&gt;
              &lt;asp:CheckBoxField DataField="Check Box 12" HeaderText="Check Box 12" SortExpression="Check Box 12" /&gt;
                &lt;/asp:Panel&gt;
              &lt;CC1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" Collapsed="true" ExpandControlID="pnlClick" TextLabelID="lblMessage" CollapsedText="Click To Show" ExpandedText="Click To Hide" ImageControlID="imgArrows" ExpandDirection="Vertical" TargetControlID="pnlCollapsable" ScrollContents="false" runat="server"&gt;&lt;/CC1:CollapsiblePanelExtender&gt;
  
              &lt;asp:BoundField DataField="Field 10" HeaderText="Field 10" SortExpression="Field 10" /&gt;
              &lt;asp:BoundField DataField="Field 11" HeaderText="Field 11" SortExpression="Field 11" /&gt;
              &lt;asp:BoundField DataField="Field 12" HeaderText="Field 12" SortExpression="Field 12" /&gt;
              &lt;asp:CommandField ShowEditButton="True" /&gt;
          &lt;/Columns&gt;
          &lt;EditRowStyle BackColor="#2461BF" /&gt;
          &lt;FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
          &lt;HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
          &lt;PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /&gt;
          &lt;RowStyle BackColor="#EFF3FB" /&gt;
          &lt;SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /&gt;
          &lt;SortedAscendingCellStyle BackColor="#F5F7FB" /&gt;
          &lt;SortedAscendingHeaderStyle BackColor="#6D95E1" /&gt;
          &lt;SortedDescendingCellStyle BackColor="#E9EBEF" /&gt;
          &lt;SortedDescendingHeaderStyle BackColor="#4870BE" /&gt;
      &lt;/asp:GridView&gt;
  
      &lt;sql connection strings, insert/update SQL code, update parameters, and closing ASP/HTML tags&gt;
  </code></pre>