Adding an additional option to a bound dropdown list

  • Thread starter Thread starter estafford
  • Start date Start date
E

estafford

I have a dropdownlist control that is filled using a database query.
I also want to add an additional option to the list that is not pulled from
the database.
How can I go about doing that?

I've tried adding a list item to the control, but that seems to be
overwritten by the databinding.

Thanks for any help
ES
 
Add it after DataBind() using Items.Add, or Items.Insert if you need it at a
specific location.

HTH,

bill
 
Brilliant!
Thanks William.

I was using items.Add but it placed the option at the end of the list and I
had to write extra code to have it selected by default. The Items.Insert was
exactly what I needed.

Thank You for you help...
ES
 

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