Adding value to dropdownlist

G

Guest

I have a dropdown bound to database. I need to add Select one to the first
index of drop down list.

How can i do this?

Thanks

Manny
 
G

Guest

After you have populated your dropdown use something like the following
(assuming your dropdown is ddlList)

ListItem li = new ListItem("Text","Value");
ddlList.Items.Insert(0,li);
ddlList.SelectedIndex = 0;

This should Work

Tasos
 
L

Lucas Tam

I have a dropdown bound to database. I need to add Select one to the
first index of drop down list.

How can i do this?


Dim li as listitem = new listitem("MyText", Value)

ddl.items.add(li)

: )
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top