473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 1440
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Evan | last post by:
I have searched high and low and am posting this question in the hope that someone out there on the net can help me out. I am using a merge of ASP and JavaScript. My goal is to create 2 drop...
5
by: Derek | last post by:
Let's say I have a dynamic list/menu, which gets its values from a database table, for example a list of contact people where the value is an ID number and the label is the name. However, if the...
6
by: Sebi | last post by:
Hello all, I'm thinking about overwriting the ListItem, so it can contain x additional values (not only one). Has anybody ever tried this? Has someone got an example (C#)? Can DropDownList...
2
by: Manny Chohan | last post by:
I have a dropdown bound to database. I need to add Select one to the first index of drop down list. How can i do this? Thanks Manny
6
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for...
1
by: JohnR | last post by:
I'm using oledb to an Access datatable. I load the table into a dataset. I create databindings to link the fields on my form to the corresponding fields in the datatable. The tables...
2
by: Crazy Cat | last post by:
I am using a data-bound combobox with dropdownstyle set to dropdownlist. Teh combobox is bound to a bindingsource which is in turn bound to a table in my database. The table has only 4 rows and I...
2
by: Bruno Alexandre | last post by:
Hi guys, I'm using Javascript to dynamically add to a dropdown values like for ( i=0; i<tv.length; i++ ) { selectDDAvisCtrl.options = new Option(tv, tv); } and I use ...
1
by: bytesFTW99 | last post by:
I have been struggling with this for some time can anyone help out? just trying to have 3 dropdown boxes that fill depending on what is selected, then in some cases click a button and have the second...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.