Question

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

Was it helpful?

Solution

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!

OTHER TIPS

Do you have a telerik:RadScriptManager on the page?

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...

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top