This is a migrated thread and some comments may be shown as answers.

RadPanelBar with single root item and headertemplate

1 Answer 73 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Bart Reekmans
Top achievements
Rank 1
Bart Reekmans asked on 20 Jul 2012, 07:09 AM
Hi,

I'm trying to create a panelbar with a single (root) item which I can expand and collapse. 
I've found the solution in this help section
Now I'm tryning to add a button in the header of this root item, but without succes (setting the headertemplate for the root item works, but the expand/collapse button disappears)

This is the complete code of my page : 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Detail.aspx.cs" Inherits="Mobile_Detail" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager" runat="server" />
    <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="742px" Height="330px"
        Skin="MetroTouch" ExpandMode="FullExpandedItem" AllowCollapseAllItems="true">
        <CollapseAnimation Type="None"></CollapseAnimation>
        <Items>
            <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1">
            <HeaderTemplate><asp:Button runat="server" Text = "TEST" /></HeaderTemplate>
                <Items>
                    <telerik:RadPanelItem Expanded="false">
                        <ItemTemplate>
                            TEST</ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
    </form>
</body>
</html>


How can i achieve this? Thx

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Jul 2012, 09:50 AM
Hi Chris,

This is the expected behavior. The HeaderTemplate allows you to specify any content you need, so you can use it to add a custom image as well.

Kind regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
PanelBar
Asked by
Bart Reekmans
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or