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

Dynamic PanelBar Width Issue

1 Answer 99 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Brad Burnette
Top achievements
Rank 1
Brad Burnette asked on 12 Jun 2014, 05:11 PM
I have a RadPanel on my page:

            <telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="MultipleExpandedItems" Width="95%">
            </telerik:RadPanelBar>        

I dynamically add RadPanelItems to it in code behind that have a custom user control in it:
   foreach(xxx)
  {
                    RadPanelItem newPanelItem = new RadPanelItem("Header Text");
                    RadPanelItem childPanelItem = new RadPanelItem();

                    childPanelItem.Controls.Add(LoadControl("xxx.ascx"));
                    ctrl.LoadData();

                    newPanelItem.Items.Add(childPanelItem);
                    newPanelItem.Width = Unit.Percentage(100);
                    RadPanelBar1.Items.Add(newPanelItem);
  }

The LoadData method fills a grid in the user control. In my development this creates 5 collapsible RadPaneltems as expected. However, the width of the PanelBar isn't working correctly. As you can see it's set to 95% but when I run it seems to collapse down to the size of the header text. When I expand on of the panel items, the width indeed increases to the size of the panel item content (based on the grid). It's like the PanelBar can't figure out it's width based on its PanelItems because they are dynamically added.

Without setting the width to a fixed size, how can I get the PanelBar to fill 95% of its container so it doesn't shrink?

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 17 Jun 2014, 11:54 AM
Hello Brad,

We tried to replicate the described problem locally, but to no avail. You could find the sample project, I have tested with in the attachment. Could you modify it and send it back to us so we could inspect the issue you are facing. In addition, specify the currently used version of our controls and the browser, under which the issue occurs.

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PanelBar
Asked by
Brad Burnette
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or