How to Add User Control in RadListBoxItem

Thread is closed for posting
2 posts, 0 answers
  1. Jay Jose
    Jay Jose avatar
    13 posts
    Member since:
    Jul 2009

    Posted 23 Sep 2009 Link to this post

    Hi Guys,

    I create a User Control (implements UserControl), is it possible to add it in ImageAndTextLayoutPanel and remove the other children?

    RadListBoxItem item = new RadListBoxItem();
    item.Text = "Title" + i;
    item.DescriptionText = "Description with very long text";
    ImageAndTextLayoutPanel layoutPanel = (ImageAndTextLayoutPanel)item.Children[2];


    UserControl1 uc = new UserControl1();

    something like this:

    Thanks in advance.


  2. Nikolay
    Nikolay avatar
    1805 posts

    Posted 28 Sep 2009 Link to this post

    Hi Jay Jose,

    You do not need to remove the children elements from a RadListBoxItem in order to add a UserControl. You can directly add the UserControl (with the help of RadHostItem) to the RadListBoxItem. Please note that the Virtualizaiton of RadListBox should be turned off when you add user controls. In addition, a UserControl is a heavy object for a scrolling operation, so you may experience performance decrease while scrolling up and down.

    If you have additional questions, feel free to contact me.

    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