or

After much pain and agony with RadPanelBar and user controls, I'm trying a different approach in using ItemTemplates for the Panel bar items with databinding to a custom object collection. Now I'm having problems collapsing the different items. I know that I cannot collapse root items and have tried to follow your examples on how structure my panel bar properly to allow for collapse/expand but I cannot find any documentation in regards to data-bound panel bars.. and I cannot spend anymore time on this one little part of my website.
Here's my markup, designed per http://www.telerik.com/help/aspnet-ajax/panelbar-troubleshooting-root-items-collapse.html:
| <telerik:RadPanelBar ID="radPanelBarAccountList" Runat="server" Height="200%" |
| Width="100%" Skin="Vista" AllowCollapseAllItems="True"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Text="Replace With Account Name"> |
| <Items> |
| <telerik:RadPanelItem> |
| <ItemTemplate> |
| <UC1:AccountInfo ID="AccountInfo1" runat="server" AccountID='<%# DataBinder.Eval(Container.DataItem, "Id") %>' /> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
| 'Get collection of accounts |
| Dim accountCollection As Collection(Of FIAccount) |
| Dim accountsPresenter = New AccountsPresenter(New Guid(Session("SubscriberId").ToString), BasePage.GetCultureName.ToString()) |
| accountCollection = accountsPresenter.GetAccounts("Actual", False, Account.AccountStatus.All) |
| 'Bind panel bar |
| With radPanelBarAccountList |
| .DataSource = accountCollection.ToList |
| .DataTextField = "Name" |
| .DataValueField = "Id" |
| .DataBind() |
| End With |