Hi, i need some help with the following scenario..
While prototyping we built the following RadPanel (with a dozen items, in this example there are just two items included), and this works perfect.
But we have to create all the items dynamically.
Now this is my .aspx code:
and this the code-behind (dt contains all the needed fields):
The result looks quite different. I would be very happy if you could help me with this one. I suppose i'm doing something wrong with the itemtemplate (?) ..
All the best
Tom
While prototyping we built the following RadPanel (with a dozen items, in this example there are just two items included), and this works perfect.
| <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Web20" Width="230px" |
| ExpandMode="SingleExpandedItem" ExpandAnimation-Type="InOutSine" ExpandAnimation-Duration="300"> |
| <Items> |
| <telerik:RadPanelItem Text="MYTITLE"> |
| <Items> |
| <telerik:RadPanelItem> |
| <ItemTemplate> |
| <table border="0" cellpadding="0" cellspacing="0"> |
| <tr> |
| <td> |
| <p class="normal"> |
| MYTEXT BLABLA |
| </p> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| <telerik:RadPanelItem Text="MYTITLE 2"> |
| <Items> |
| <telerik:RadPanelItem> |
| <ItemTemplate> |
| <table border="0" cellpadding="0" cellspacing="0"> |
| <tr> |
| <td> |
| <p class="normal"> |
| MYTEXT 2 BLBABLABLA |
| </p> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
But we have to create all the items dynamically.
Now this is my .aspx code:
| <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Web20" Width="230px" |
| ExpandMode="SingleExpandedItem" ExpandAnimation-Type="InOutSine" ExpandAnimation-Duration="300"> |
| <Items> |
| <telerik:RadPanelItem> |
| <ItemTemplate> |
| <table border="0" cellpadding="0" cellspacing="0" width="230"> |
| <tr> |
| <td> |
| <p class="normal"> |
| <%# Container.DataItem("Text") %> |
| </p> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
and this the code-behind (dt contains all the needed fields):
| For Each row As DataRow In dt.Rows |
| Dim topItem As New RadPanelItem |
| topItem.Text = row.Item("Title").ToString.Substring(0, 10) |
| topItem.Expanded = False |
| RadPanelBar1.Items.Add(topItem) |
| Dim subItem As New RadPanelItem |
| subItem.Text = row.Item("Text").ToString |
| subItem.Expanded = False |
| topItem.Items.Add(subItem) |
| Next |
The result looks quite different. I would be very happy if you could help me with this one. I suppose i'm doing something wrong with the itemtemplate (?) ..
All the best
Tom