title: CollapsiblePanelExtender in nested Repeater and Gridview setup doesn't function
body: <p>I have a setup using three levels of nesting: A Repeater, the items of which utilize CollapsiblePanelExtenders (which work), and each contain a GridView. Each of these then contain another GridView which is controlled by another CollapsiblePanelExtender. These inner CollapsiblePanels will effectively show either an expanded or collapsed state only if I set clientState to True. However, they do not effectively expand or collapse as expected. Everything is bound dynamically.</p>
  
  <p>Here is the markup...</p>
  
  <pre><code>&lt;asp:Repeater ID="cat_repeater" runat="server"&gt;
    &lt;ItemTemplate&gt;
      &lt;asp:CollapsiblePanelExtender id="cat_cpExt" runat="server" TargetControlID="cat_pnl" CollapsedSize="0" Collapsed="false" CollapsedImage="collapsed.png" ExpandedImage="expanded.png" ExpandControlID="cpControl_pnl" CollapseControlID="cpControl_pnl" TextLabelID="cpControl_lbl" ImageControlID="cpControl_img" CollapsedText='&lt;%#configCPText(eval("Title"), False)%&gt;' ExpandedText='&lt;%#configCPText(eval("Title"), True) %&gt;' /&gt;
      &lt;asp:Panel ID="cpControl_pnl" runat="server" Visible='&lt;%#itemVisible(eval("ID"), "Recipients", "CategoryID") %&gt;' CssClass="CPanelStyle"&gt;
        &lt;asp:Image ID="cpControl_img" runat="server" ImageUrl="expanded.png" /&gt;
        &lt;asp:Label ID="cpControl_lbl" runat="server" Text='&lt;%#configCPText(eval("Title"), True) %&gt;' CssClass="CPanelText" /&gt;
      &lt;/asp:Panel&gt;
      &lt;asp:Panel ID="cat_pnl" runat="server"&gt;
        &lt;asp:GridView ID="recipients_gv" runat="server" CssClass="GVStyle" HeaderStyle-CssClass="GVHeaderStyle" RowStyle-CssClass="GVItemStyle" AutoGenerateColumns="false" GridLines="none" AllowPaging="false"&gt;
          &lt;Columns&gt;
            &lt;asp:TemplateField HeaderText="Name" SortExpression="Last Name" ItemStyle-CssClass="GVNameStyle"&gt;
              &lt;ItemTemplate&gt;
                &lt;asp:Literal id="name_lit" runat="server" text='&lt;%#formatNameText(eval("FirstName"), eval("LastName")) %&gt;' /&gt;
              &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="Gifts" ItemStyle-Width="500px"&gt;
              &lt;ItemTemplate&gt;
                &lt;asp:CollapsiblePanelExtender id="gifts_cpExt" runat="server" TargetControlID="gifts_pnl" CollapsedSize="0" Collapsed="true" CollapsedImage="collapsed.png" ExpandedImage="expanded.png" ExpandControlID="cpControl_pnl2" CollapseControlID="cpControl_pnl2" TextLabelID="cpControl_lbl2" ImageControlID="cpControl_img2" CollapsedText='&lt;%#configGiftsCPText(eval("ID"), True)%&gt;' ExpandedText='&lt;%#configGiftsCPText(eval("ID"), False) %&gt;' /&gt;
                &lt;asp:Panel ID="cpControl_pnl2" runat="server" Visible='&lt;%#itemVisible(eval("ID"), "Gifts", "RecipientID") %&gt;'&gt;
                  &lt;asp:Image ID="cpControl_img2" runat="server" ImageUrl="collapsed.png" /&gt;
                  &lt;asp:Label ID="cpControl_lbl2" runat="server" Text='&lt;%#configGiftsCPText(eval("ID"), False) %&gt;' /&gt;
                &lt;/asp:Panel&gt;
                &lt;asp:Panel ID="gifts_pnl" runat="server"&gt;
                  &lt;asp:GridView ID="gifts_gv" runat="server" DataKeyNames="ID" RowStyle-CssClass="GVInnerItemStyle" HeaderStyle-CssClass="GVInnerHeaderStyle" Gridlines="None" AutoGenerateColumns="false" AllowPaging="false" Width="475px"&gt;
                    &lt;Columns&gt;
                      &lt;asp:TemplateField ItemStyle-CssClass="GVInnerButtonItemStyle" HeaderText="Description"&gt;
                        &lt;ItemTemplate&gt;
                          &lt;asp:LinkButton ID="gift_lBtn" runat="server" Text='&lt;%#eval("Description") %&gt;' CommandName="Select" /&gt;
                        &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="Complete" ItemStyle-Width="50px"&gt;
                        &lt;ItemTemplate&gt;
                          &lt;asp:CheckBox ID="giftComplete_cbx" runat="server" Checked='&lt;%#eval("Complete") %&gt;' /&gt;
                        &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                    &lt;/Columns&gt;
                  &lt;/asp:GridView&gt;
                &lt;/asp:Panel&gt;
              &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
          &lt;/Columns&gt;
        &lt;/asp:GridView&gt;
      &lt;/asp:Panel&gt;
      &lt;br /&gt;
    &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>...And here is the code to bind everything: </p>
  
  <pre><code>Protected Sub bindCategories()
  
      Try
          oCmd.Connection = oConn
          oCmd.CommandType = CommandType.Text
  
          strSQL = "SELECT * FROM Categories"
  
          oCmd.CommandText = strSQL
          oDA.SelectCommand = oCmd
  
          oDA.Fill(oDTbl)
  
          cat_repeater.DataSource = oDTbl
          cat_repeater.DataBind()
  
          For i As Integer = 0 To oDTbl.Rows.Count - 1
  
  
              oCmd.Parameters.Clear()
              inner_dTbl.Clear()
  
              strSQL = "SELECT *, Title FROM Recipients INNER JOIN Categories on Recipients.CategoryID = Categories.ID WHERE CategoryID = @CategoryID ORDER BY LastName"
  
              oParam = New SqlParameter
              oParam.ParameterName = "CategoryID"
              oParam.SqlDbType = SqlDbType.Int
              oParam.Value = oDTbl.Rows(i)("ID")
              oCmd.Parameters.Add(oParam)
  
              oCmd.CommandText = strSQL
              oDA.SelectCommand = oCmd
  
              oDA.Fill(inner_dTbl)
  
              Dim gv As GridView = CType(cat_repeater.Items(i).FindControl("recipients_gv"), GridView)
              gv.DataSource = inner_dTbl
              gv.DataBind()
  
              For j As Integer = 0 To inner_dTbl.Rows.Count - 1
  
                  oCmd.Parameters.Clear()
                  gifts_dTbl.Clear()
  
                  strSQL = "SELECT * FROM Gifts WHERE RecipientID = @RecipientID ORDER BY Description"
  
                  oParam = New SqlParameter
                  oParam.ParameterName = "RecipientID"
                  oParam.SqlDbType = SqlDbType.Int
                  oParam.Value = inner_dTbl.Rows(j)("ID")
                  oCmd.Parameters.Add(oParam)
  
                  oCmd.CommandText = strSQL
                  oDA.SelectCommand = oCmd
  
                  oDA.Fill(gifts_dTbl)
  
                  Dim inner_gv As GridView = CType(gv.Rows(j).FindControl("gifts_gv"), GridView)
                  inner_gv.DataSource = gifts_dTbl
                  inner_gv.DataBind()
  
                  Dim cpExt As CollapsiblePanelExtender = CType(gv.Rows(j).FindControl("gifts_cpExt"), CollapsiblePanelExtender)
                  cpExt.Collapsed = True
                  cpExt.ClientState = True
  
              Next
  
          Next
      Catch ex As Exception
          Throw ex
      End Try
  
  End Sub
  </code></pre>
  
  <p>I've successfully used CollapsiblePanelExtenders in a 2-level nested GridView setup that without a problem before, and without having to set clientState. However, I've had to specify clientState when using CollapsiblePanelExtenders with Repeaters before.</p>
  
  <p>Does anyone have any input regarding why these extenders will not function in this 3-level nested setup?</p>