populating a dropdown list from an arraylist
Visual Basic
2
Posts
2
Posters
0
Views
1
Watching
-
I'm trying to populate a drop down list from an arraylist. I have an array called idnums thought I could do something like this: Dim C As Integer Dim I As Integer C = idnums.Count For I = 0 To C dlIdNums.Items.Add(idnums.Item(I)) Next thanks
Are you taking about a ComboBox or ASP.NET Control DropDownList No need for the Loop Just bind the Datasource to the arraylist. dlIdNums.DataSource = idnums dlIdNums.DisplayMember = "name" or DataTextField(ASP) dlIdNums.ValueMember = "value" or DataValueField(ASP) Check Help if I am wrong it is in there.