Dynamic PanelBar Width Issue

2 posts, 0 answers
  1. Brad Burnette
    Brad Burnette avatar
    6 posts
    Member since:
    Apr 2010

    Posted 12 Jun 2014 Link to this post

    I have a RadPanel on my page:

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

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


                        newPanelItem.Width = Unit.Percentage(100);

    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?
  2. Nencho
    Nencho avatar
    1446 posts

    Posted 17 Jun 2014 Link to this post

    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.


    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.

  3. Telerik UI for ASP.NET Core is out
Back to Top