Hello,
I tried to adopt what was done in your MVC forum sample project for the RadPanelBar. What I want to do is add a series of RadPanelItem's that contain a RadListBox control as its interface. The RadListBox will be data bound. But I'm getting an error about adding controls after prerender. Is there something I can do to remedy that, or do the RadPanelItem/RadListBox have to be hard coded in?
My approach was:
<%
if (Model.Groups != null)
{
foreach (var group in Model.Groups)
{
RadListBox box = new RadListBox();
box.DataSource = group.Items;
box.DataTextField = "Name";
box.DataValueField = "Key";
box.DataBind();
RadPanelItem item = new RadPanelItem(group.Name);
item.Controls.Add(box);
rpbContacts.Items.Add(item);
}
}
%>
<tel:RadPanelBar ID="rpbContacts" runat="server" />
Thanks.
I tried to adopt what was done in your MVC forum sample project for the RadPanelBar. What I want to do is add a series of RadPanelItem's that contain a RadListBox control as its interface. The RadListBox will be data bound. But I'm getting an error about adding controls after prerender. Is there something I can do to remedy that, or do the RadPanelItem/RadListBox have to be hard coded in?
My approach was:
<%
if (Model.Groups != null)
{
foreach (var group in Model.Groups)
{
RadListBox box = new RadListBox();
box.DataSource = group.Items;
box.DataTextField = "Name";
box.DataValueField = "Key";
box.DataBind();
RadPanelItem item = new RadPanelItem(group.Name);
item.Controls.Add(box);
rpbContacts.Items.Add(item);
}
}
%>
<tel:RadPanelBar ID="rpbContacts" runat="server" />
Thanks.