This is a migrated thread and some comments may be shown as answers.

How to Add User Control in RadListBoxItem

1 Answer 74 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jay Jose
Top achievements
Rank 1
Jay Jose asked on 23 Sep 2009, 12:59 PM
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           

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 28 Sep 2009, 03:21 PM
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.
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Jay Jose
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or