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

Databinding a control in the ItemTemplate

1 Answer 113 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 16 Aug 2011, 04:36 PM
I have a RadPanelBar bound to a datasource.  In the ItemTemplate I have checkboxlist bound to another datasource.  The select parameter for the datasource for the checkboxlist is the RadPanelItem's value.

This is probably very straight forward and would appreciate some help in accomplishing this.

Thanks
Sumith

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 19 Aug 2011, 02:29 PM
Hello Sumith,

In general the HeaderTemplate and the ContentTemplate have different functionality and behaviour compared to the ItemTemplate. Using the HeaderTemplate and the ContentTemplate (in the markup) you can create templates for every individual item while with the ItemTemplate you can create a template that is valid and can be applied to every item of the RadPanelBar. Therefore when you bind the RadPanelBar to datasource the HeaderTemplate does not appear and is replaced by the data that comes from the database. In this case a valid approach would be to create a HeaderTemplate in code behind and instantiate it in every item thus it would serve as a global template for all of the items. For example this help article describes how this could be achieved using ItemTemplate (you could use the same approach for HeaderTemplate). However, currently this approach is not applicable since there is a bug that prevents the correct rendering of such template. Therefore I would recommend that you use the ItemTemplate in order to accomplish the desired behaviour.

Please note that you can not bind a HeaderTemplate to a datasource which is a current limitation of the RadPanelBar

Greetings,
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