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?
<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?