Q: dropdown list, no selected value

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Call this in Page_Load(or some other handler):
ListItem li = new ListItem("-1", "");
myDDL.Items.InsertAt(0, li);

Regards,
Kostadin Kostov
 
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

Back
Top