This is a migrated thread and some comments may be shown as answers.

Databound RadPanelBar - Controls dynamically added to child RadPanelItem

1 Answer 52 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Sumith Jayasuriya
Top achievements
Rank 1
Sumith Jayasuriya asked on 02 Aug 2011, 10:08 PM
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.

Thanks
Sumith

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 03 Aug 2011, 12:22 PM
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,
Kate
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.

Tags
PanelBar
Asked by
Sumith Jayasuriya
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or