Q: dropdown list, no selected value

G

Guest

I am populating dropdown list with binding dataset, and dropdown list shows
first item by default when application is launched, is there any way I can
set it be empty and let user select one?
 
G

Guest

Call this in Page_Load(or some other handler):
ListItem li = new ListItem("-1", "");
myDDL.Items.InsertAt(0, li);

Regards,
Kostadin Kostov
 
E

Eliyahu Goldin

You have a choice of adding an empty row to either ddl itself or to the
bound dataset.

Eliyahu
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top