RadPanelItem with RadListBox dynamic binding?

Thread is closed for posting
2 posts, 1 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 30 Oct 2009 Link to this post


    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";


            RadPanelItem item = new RadPanelItem(group.Name);


    <tel:RadPanelBar ID="rpbContacts" runat="server" />

  2. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 04 Nov 2009 Link to this post

    Hello Brian,

    To achieve your goal you will need to render the controls with HtmlHelper. Here is attached a simple test project which shows how to use RadHtmlHelper.

    Georgi Krustev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top