Problem with data binding RadPanelBar and collapse/expand its elements

2 posts, 0 answers
  1. Krasimir
    Krasimir avatar
    14 posts
    Member since:
    Feb 2009

    Posted 22 Oct 2010 Link to this post


    I have a problem with the RadPanelBar when I try to bind it to an OpenAccessDataSource. I have a single level list of data that I try to bind. The problem is that when I bind the control the items are not collapsible. The markup that I use is: 

    <telerik:RadPanelBar ID="rpbContainers" runat="server" DataTextField="Name" DataSourceID="oadsContainers" DataValueField="ID" Width="100%" Skin="Windows7" ExpandMode="MultipleExpandedItems"
        AppendDataBoundItems="true" >
            <telerik:RadPanelItem Text="New Container" Value="-1" Expanded="true">
                    Create new container
                            <%# Eval("Name") %>

    I also want to have a default element binded to the PanelPar, such as in a drop down's default element. 

    Kind regards,
  2. Nikolay Tsenkov
    Nikolay Tsenkov avatar
    734 posts

    Posted 27 Oct 2010 Link to this post

    Hello Krasimir,

    The problem here is that RadPanelItem in not a contol. You actually can see that there is no intellisense for it, when you try to type it down outside of <items></items> clause.

    My advice would be to create the template in the code-behind as a class implementing the ITemplate interface, to handle the TemplateNeeded event of RadPanelBar and having that it's thrown for each and every item during the dataBinding process you can even decide what template to assign (if having more that one types of items).

    Here is a reference for creating the template(s):

    Here is a reference to the TemplateNeeded event of RadPanelBar:

    Please, let me know if the suggested worked for you!
    I hope this is helpful!

    Nikolay Tsenkov
    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
Back to Top