469,648 Members | 1,407 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

Adding an additional option to a bound dropdown list

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
Nov 18 '05 #1
2 1368
Add it after DataBind() using Items.Add, or Items.Insert if you need it at a
specific location.

HTH,

bill

"estafford" <estafford your pants @newmancom.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2
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

"William F. Robertson, Jr." <wfrobertson_at_kpmg_dot_com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
Add it after DataBind() using Items.Add, or Items.Insert if you need it at a specific location.

HTH,

bill

"estafford" <estafford your pants @newmancom.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Manny Chohan | last post: by
6 posts views Thread by Juan Pedro Gonzalez | last post: by
2 posts views Thread by Crazy Cat | last post: by
2 posts views Thread by Bruno Alexandre | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.