DropDownList

J

Jim Heavey

When you are binding a dropdown to a datasource, you have
2 properties to set, the DataTextField and DataValueField.

If you are going to load the entries manually in code
rather then use the databind, how do you set these
properties?

I know (think) that if you are just loading the "text"
field, you just go drpdwon.items.add("MyTest"), but how
do you populate the equivalent to the "value" field.

Thanks in advance for your assistance!!!!!!!
 
K

Kevin Spencer

MyDropDownList.Items.Add(New ListItem("Your Text Here", "Your Value Here"))

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top