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

Adding Items to RadListBox Control

1 Answer 108 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.
cathe
Top achievements
Rank 1
cathe asked on 07 Jun 2007, 02:01 AM
I need to add a list of items to a radlistbox control, and I can do it fine with the MS version, but this does not work.  I am using the following syntax:

        Me.RadListBox2.Items.Add("test11")
        Me.MediaListVisible.Items.Add("test11")

Can anyone give me some examples please? 

Thanks in advance..

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 07 Jun 2007, 04:04 PM
Hi cathe,

You're trying to use the Add method of the  Items collection with a string parameter. The Items collection is a collection of objects of type RadItem, in your case - objects of type RadListBoxItem. You should always use objects of  type RadListBoxItem or its descendants when you work with Items collection. 

Your code should be as follows:

Dim test1 as RadListBoxItem = New RadListBoxItem("test11")
Me.RadListBox2.Items.Add(test1)

 
 
Greetings,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
cathe
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or