How to Add User Control in RadListBoxItem

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

    layoutPanel.Children.Remove(layoutPanel.Children[0]);
    layoutPanel.Children.Remove(layoutPanel.Children[0]);

    UserControl1 uc = new UserControl1();

    something like this:
    ayoutPanel.Children.Add(uc);

    Thanks in advance.

    Regards,
    Jay           

  2. Nikolay
    Admin
    Nikolay avatar
    1804 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.

    Greetings,
    Nikolay
    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top