Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding an additional option to a bound dropdown list

Reply
Thread Tools

Adding an additional option to a bound dropdown list

 
 
estafford
Guest
Posts: n/a
 
      11-18-2004
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


 
Reply With Quote
 
 
 
 
William F. Robertson, Jr.
Guest
Posts: n/a
 
      11-18-2004
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:%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
estafford
Guest
Posts: n/a
 
      11-18-2004
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:(E-Mail Removed)...
> 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:%(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bound Dropdown List - doens't allow for user input? blouie ASP .Net 6 03-29-2007 10:27 AM
Bound Dropdown list not filling before load events. Victoria Bolton ASP .Net 0 05-19-2006 10:02 PM
Form option list adding a 2nd option based upon the first. mike.a.rea@gmail.com Javascript 7 02-17-2006 02:13 AM
Appending option items in dropdown in parent window from dropdown in Child window in IE Bostonasian Javascript 1 02-14-2005 02:22 AM
Syste.Drawing.Color bound to a dropdown list =?Utf-8?B?S2V2aW4gSm9obnNvbg==?= ASP .Net 2 05-24-2004 02:21 AM



Advertisments