Icemanind
Icemanind

Reputation: 48686

Radpanelbar collapse/expand issue

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

Upvotes: 2

Views: 10507

Answers (4)

TiagoSC
TiagoSC

Reputation: 48

You can use ContentTemplate:

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

Upvotes: 0

Maarten Louage
Maarten Louage

Reputation: 115

Did you try the above method when adding databound controls in the ItemTemplate? So for instance where you have written "... Standard HTML Template code here ..." to put:

<ItemTemplate>
   <asp:Label ID="lblText" runat="server" Text="The index has as ID "></asp:Label>
   <asp:Label ID="lblIndexID" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
</ItemTemplate>

My ItemTemplate is always empty. I'm binding to an ICollection. I can't figure out why this isn't working...

Upvotes: 0

Atanas Korchev
Atanas Korchev

Reputation: 30661

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!

Upvotes: 4

ajh1138
ajh1138

Reputation: 566

Do you have a telerik:RadScriptManager on the page?

Upvotes: 0

Related Questions