Databound RadPanelBar - Controls dynamically added to child RadPanelItem

2 posts, 0 answers
  1. Sumith Jayasuriya
    Sumith Jayasuriya avatar
    25 posts
    Member since:
    Jan 2010

    Posted 02 Aug 2011 Link to this post

    I have a RadPanelBar that is databound.  Based on the values contained in the datasource, certain controls will be added to each child item.  Controls such as dropdown, listbox, multiple labels, textboxes and buttons are added.  On clicking a button or dropdown selectedindexchanged the controls disappear.  I have tried creating dynamic controls in PanelBar_prerender event and they are created appropriately and displayed on the initial page_load,

    On the subsequent pages, unless I do a PanelBar.DataBind, I get weird situation where the first child item disappears and the last child item repeats.  On the next postback what was now the first child item will disappear and the last child item will now appear three times.

    I have seen the example where panelitems are created in the page_load event.  However, what I have is a databound PanelBar.  I have seen references to "templateneeded" event, but none of the links seem to work to get to that article.

    Can you provide an example of where controls are added dynamically to child panelitem when the PanelBar itself is databound and the dynamically created controls need to postback.

  2. Kate
    Kate avatar
    1898 posts

    Posted 03 Aug 2011 Link to this post

    Hello Sumith,

    For more reference on the TemplateNeeded event for the RadPanelBar control you can take a look here. Furthermore you could also refer to all the events that you can use with the RadPanelBar control - RadPanelBar Members. Additionally, here is a very good help article that describes how you can add templates at runtime.

    Kind regards,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top