Radpanelbar collapse/expand issue

Icemanind picture Icemanind · Jul 25, 2009 · Viewed 10.2k times · Source

Guys, I am having an issue with Telerik's RadPanelBar control. I have the Q1 2009 version of the controls. I have the follow ASP.NET code:

<telerik:RadPanelBar Width="297px" ID="RadPanelBar1" runat="server" Skin="Web20" AllowCollapseAllItems="True" ExpandMode="SingleExpandedItem" PersistStateInCookie="True">
    <Items>
            <telerik:RadPanelItem runat="server" Text="Standard Reports" Expanded="True">
                  <ItemTemplate>
                        ... Standard HTML Template code here ...
                  </ItemTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Expanded="false" Text="NonStandard Reports">
                   <ItemTemplate>
                             <asp:Label runat="server" Text="test"></asp:Label>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
       </Items>
</telerik:RadPanelBar>

Everything works fine, except I cannot expand or collapase the headers. My cursor changes to a hand when I hover over the headers, however nothing happens when I click on the header. Can someone help me out?

Thanks

Answer

Atanas Korchev picture Atanas Korchev · Jul 27, 2009

If you set the ItemTemplate of top level items - you will define the content of the item not the collapsible area. To solve the problem define a child item and set its ItemTemplate property instead:

<telerik:RadPanelBar runat="server">
   <Items>
       <telerik:RadPanelItem Text="Standard Reports">
          <Items>
              <telerik:RadPanelItem>
                 <ItemTemplate>
                     ... Standard HTML Template code here ...
                 </ItemTemplate>
              </telerik:RadPanelItem>
          </Items>
       </telerik:RadPanelItem>
   </Items>
</telerik:RadPanelBar>

I hope this helps!