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

DataBound PanelBar Won't Expand

4 Answers 74 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Josh McCullough
Top achievements
Rank 1
Josh McCullough asked on 02 Jul 2010, 02:14 AM
I've read the issue here: http://www.telerik.com/help/aspnet-ajax/panelbar-troubleshooting-root-items-collapse.html but I still can't get the root items to expand.

My ASPX:
    <Telerik:RadPanelBar ID="panelBar" runat="server" Width="100%" ExpandMode="MultipleExpandedItems">  
        <Items> 
            <Telerik:RadPanelItem> 
                <Items> 
                    <Telerik:RadPanelItem> 
                        <ItemTemplate> 
                            <%# Eval("ShortDefinition") %> 
                        </ItemTemplate> 
                    </Telerik:RadPanelItem> 
                </Items> 
            </Telerik:RadPanelItem> 
        </Items> 
        <DataBindings> 
            <Telerik:RadPanelItemBinding TextField="Label" Expanded="false" /> 
        </DataBindings> 
    </Telerik:RadPanelBar> 

My Code Behind:
namespace MyNamespace  
{  
    public partial class MyPage : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            panelBar.DataSource = new[]  
            {  
                new { Label="One", ShortDefinition="This is #1." },  
                new { Label="Two", ShortDefinition="This is #2." },  
                new { Label="Three", ShortDefinition="This is #3." },  
                new { Label="Four", ShortDefinition="This is #4." },  
                new { Label="Five", ShortDefinition="This is #5." }  
            };  
            panelBar.DataBind();  
        }  
    }  

This produces a list of PanelItems (One, Two, etc.) but they are not expandable and there is no content.

Thanks!

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 05 Jul 2010, 03:24 PM
Hi Josh McCullough,

You cannot set templates like this,  because you also create declaratively items which are lost after the panelbar is databound. I've attached a modified version of your code to demonstrate how to achieve the needed approach. If you need a more complicated template, you should create it in the code behind.
Please try the attached file and let us know what you think.

Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Josh McCullough
Top achievements
Rank 1
answered on 05 Jul 2010, 05:03 PM
Thanks for posting a possible solution, However, in my case the contents will be much more complex so this won't work for me. Your solution of just adding the controls via code-behind doesn't feel right, either. I wish there was a better way to do what I need to do - but I just ended up writing a simple CollapsiblePanel control to use instead of the PanelBar in this case.

Thanks.
0
Yana
Telerik team
answered on 08 Jul 2010, 12:23 PM
Hello Josh ,

I'm sorry that the panelbar didn't meet your requirements.

RadPanelBar will provide a new content template from Q2 2010 release. It will be available next week, so you can check it out.

Best regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Josh McCullough
Top achievements
Rank 1
answered on 08 Jul 2010, 01:37 PM
I look forward to checking it out, thank you!
Tags
PanelBar
Asked by
Josh McCullough
Top achievements
Rank 1
Answers by
Yana
Telerik team
Josh McCullough
Top achievements
Rank 1
Share this question
or