Databinding a control in the ItemTemplate

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

    Posted 16 Aug 2011 Link to this post

    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.

  2. Kate
    Kate avatar
    1898 posts

    Posted 19 Aug 2011 Link to this post

    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

    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