felkamau
asked on
Adding static values to drop down list
I need to add several static values to a drop down list in c#. e.g. 01, -12. I know I can achieve this through a "for loop", but I would like to use the actual values (maybe through some array of sorts?)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ArrayList values = new ArrayList();
values.add("val1");
values.add("val2");
values.add("val3");
etc...
for (int i=0; i < values.Count; i++)
dropDownList.Items.Add(val