Hello, I'm having a bit of trouble trying to put nested controls in a databound RadPanel. What I want is basically the same as this example:
http://www.telerik.com/help/aspnet-ajax/panel_templatesoverview.html
However, the problem is that I do not know how many items I'm going to have until run time.
If I have
and my codebehind looks like
What happens is that the item template is created correctly for each item, with each item heading correct, however there's a duplicate set of controls attached to each item as seen on the attached image (each date should only have one set of controls).
I see similar behavior in static code if I remove the empty ItemTemplate place holder, but I can't seem to correct the problem for the dynamically bound panel. Any help greatly appreciated! Thank you.
http://www.telerik.com/help/aspnet-ajax/panel_templatesoverview.html
However, the problem is that I do not know how many items I'm going to have until run time.
If I have
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" ItemCreated="RadPanelBar1_ItemCreated"> |
<ItemTemplate> |
<asp:TextBox ID="txtResponse" TextMode="MultiLine" runat="server" /><br /> |
<asp:Button ID="btnSubmit" runat="server" Text="Submit" Visible="true" /> |
<asp:LinkButton ID="lbAsk" runat="server" Visible="true" /> |
<asp:LinkButton ID="lbNewEvisit" runat="server" Visible="true" /> |
</ItemTemplate> |
</telerik:RadPanelBar> |
and my codebehind looks like
protected void RadPanelBar1_ItemCreated(object sender, RadPanelBarEventArgs e) |
{ |
if (e.Item.Owner is RadPanelBar) |
{ |
RadPanelItem i = new RadPanelItem(); |
e.Item.Items.Add(i); |
} |
} |
/* Page Load Event and other stuff */ |
RadPanelBar1.DataSource = ds.Tables[0]; |
RadPanelBar1.DataTextField = "dtEvisitStart"; |
RadPanelBar1.DataBind(); |
What happens is that the item template is created correctly for each item, with each item heading correct, however there's a duplicate set of controls attached to each item as seen on the attached image (each date should only have one set of controls).
I see similar behavior in static code if I remove the empty ItemTemplate place holder, but I can't seem to correct the problem for the dynamically bound panel. Any help greatly appreciated! Thank you.