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

panelbar with itemtemplate

6 Answers 185 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 23 Sep 2008, 04:14 PM
i have a banner bar with itemtemplate but it doesn't seem to be working.  I can see the company reports and my reports but i can't have it expand and see the content inside of it. if i leave the way like the code is now it shows all and doesn't collapse. if i set the visible to false on the table i can't expand the item. here is the code below. what did i do wrong please help me. thank you very much.

<telerik:RadScriptManager ID="ScriptManager" runat="server" />

<telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="FullExpandedItem">

<CollapseAnimation Duration="100" Type="None" />

<Items>

<telerik:RadPanelItem runat="server" Text="Company Reports" Expanded="false">

<ItemTemplate>

<asp:Table runat="server" ID="tableCompanyReports" BorderWidth="0" CellPadding="0" CellSpacing="0">

<asp:TableRow>

<asp:TableCell>

<asp:DropDownList runat="server" ID="ComapnyReports"></asp:DropDownList>

</asp:TableCell>

<asp:TableCell>

<asp:Button runat="server" ID="Next" Text="Next" />

<asp:Button runat="server" ID="Save" Text="Save As" />

</asp:TableCell>

</asp:TableRow>

</asp:Table>

</ItemTemplate>

</telerik:RadPanelItem>

<telerik:RadPanelItem runat="server" Text="My Reports" Expanded="false">

<ItemTemplate>

<asp:Table runat="server" ID="tableMyReports" BorderWidth="0" CellPadding="0" CellSpacing="0">

<asp:TableRow>

<asp:TableCell>

<asp:DropDownList runat="server" ID="MyReports"></asp:DropDownList>

</asp:TableCell>

<asp:TableCell>

<asp:Button runat="server" ID="ModifyReport" Text="Modify Report" />

<asp:Button runat="server" ID="BuildNewReport" Text="Build New Report" />

</asp:TableCell>

</asp:TableRow>

</asp:Table>

</ItemTemplate>

</telerik:RadPanelItem>

</Items>

<ExpandAnimation Duration="100" Type="None" />

</telerik:RadPanelBar>

6 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 23 Sep 2008, 08:20 PM
Hey Duy,

Have you tried placing the dropdownbox and buttons in a child panelitem, like below?

<telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="FullExpandedItem">   
<CollapseAnimation Duration="100" Type="None" />   
<Items>   
<telerik:RadPanelItem runat="server" Text="Company Reports" Expanded="false">   
    <Items> 
        <telerik:RadPanelItem runat="server" Text="ReportChild"><ItemTemplate>   
        <asp:Table runat="server" ID="tableCompanyReports" BorderWidth="0" CellPadding="0" CellSpacing="0">   
        <asp:TableRow>   
        <asp:TableCell>   
        <asp:DropDownList runat="server" ID="ComapnyReports"></asp:DropDownList>   
        </asp:TableCell>   
        <asp:TableCell>   
        <asp:Button runat="server" ID="Next" Text="Next" />   
        <asp:Button runat="server" ID="Save" Text="Save As" />   
        </asp:TableCell>   
        </asp:TableRow>   
        </asp:Table> </ItemTemplate>   
        </telerik:RadPanelItem> 
    </Items> 
</telerik:RadPanelItem>   
<telerik:RadPanelItem runat="server" Text="My Reports" Expanded="false">   
    <Items> 
        <telerik:RadPanelItem runat="server" Text="ReportsChild2"><ItemTemplate>   
        <asp:Table runat="server" ID="tableMyReports" BorderWidth="0" CellPadding="0" CellSpacing="0">   
        <asp:TableRow>   
        <asp:TableCell>   
        <asp:DropDownList runat="server" ID="MyReports"></asp:DropDownList>   
        </asp:TableCell>   
        <asp:TableCell>   
        <asp:Button runat="server" ID="ModifyReport" Text="Modify Report" />   
        <asp:Button runat="server" ID="BuildNewReport" Text="Build New Report" />   
        </asp:TableCell>   
        </asp:TableRow>   
        </asp:Table> </ItemTemplate>   
        </telerik:RadPanelItem> 
    </Items> 
</telerik:RadPanelItem>   
</Items>   
<ExpandAnimation Duration="100" Type="None" />   
</telerik:RadPanelBar>  

Is that the kind of functionality that you are looking for? 

If not let me know and I'll try to help you troubleshoot a little more. :)

-Serrin
0
appdev
Top achievements
Rank 1
answered on 25 Sep 2008, 07:07 PM
yes that does work now but my problem now is i can't get the control inside of it i was trying to bind the data into the dropdown list but i couldn't get it. it doesn't see my dropdownlist for some reason. i tried to put my ddl out side of the radpanel and it worked fine and i could bind data. could you help? thanks.
0
Serrin
Top achievements
Rank 1
answered on 25 Sep 2008, 07:59 PM
Hey Duy, 

Wow, I lucked out because I found this online demo while trying to figure out something else today.  It has info on the FindControl method and using that with RadPanelBar.

Access nested controls in RadPanelBar

Let me know if this works for you...  I am gonna be using the panelbar in a future idea I have for a site (only exists in a notebook right now >.<) but I hope it's as easy as the demo makes it seem. :)
0
appdev
Top achievements
Rank 1
answered on 25 Sep 2008, 08:59 PM
but now it doesn't expand or collapse anymore.
0
appdev
Top achievements
Rank 1
answered on 25 Sep 2008, 09:09 PM
ok it will work as long as you have
radpanelbar
    item
        radpanelitem
            item
            radpanelitem
                itemtemplate

why is this? why do i need to have second radpanelitem?
0
Paul
Telerik team
answered on 26 Sep 2008, 07:24 AM
Hello Duy,

You cannot collapse a header panel item with a template. Here's a sample:

Item1
--template
Item2
--template

In this case, you cannot collapse Item1 and Item2.

Here's how the panelbar structure should look as to achieve your goal:

Item1
-- (RadpanelItem without text)
    --template
Item2
-- (RadpanelItem without text)
    --template

Regards,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
PanelBar
Asked by
appdev
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
appdev
Top achievements
Rank 1
Paul
Telerik team
Share this question
or