473,473 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Drop Down List Box Insert

I have a drop down list box on a web form. I need to insert an entry:

COF-ALL

into the list box and have it appear nefore all other entries that contain COF.

How do I do this?

Thanks,

dave
Nov 16 '05 #1
3 2286
Dave,

You should just be able to call the Add method on the ListItemCollection
that is returned by the Items property. However, if you are binding to a
data source, you might have to modify the source (through the query in the
case of a DataAdapter or the DataSet itself) in order to insert this.
Otherwise, you will have to add the items manually to the list.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"kscdavefl" <ks*******@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
I have a drop down list box on a web form. I need to insert an entry:

COF-ALL

into the list box and have it appear nefore all other entries that contain COF.
How do I do this?

Thanks,

dave

Nov 16 '05 #2
Hi dave,
You have to iterate in the Items collection until you find the correct
position, after that you just use the Insert( ) method.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"kscdavefl" <ks*******@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
I have a drop down list box on a web form. I need to insert an entry:

COF-ALL

into the list box and have it appear nefore all other entries that contain COF.
How do I do this?

Thanks,

dave

Nov 16 '05 #3
I did it this way.

Thanks,

Dave

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi dave,
You have to iterate in the Items collection until you find the correct
position, after that you just use the Insert( ) method.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"kscdavefl" <ks*******@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
I have a drop down list box on a web form. I need to insert an entry:

COF-ALL

into the list box and have it appear nefore all other entries that contain

COF.

How do I do this?

Thanks,

dave


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul M | last post by:
Hi folks, When I set the datasource of a dropdown list and bind it, the drop down list always defaults to the first item in the list. I need it to default to Nothing or NULL or whatever it is...
3
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want...
1
by: Asha | last post by:
Greetings people, I have a drop down list with populates with a list of countries... and i want to add a new value to that drop down list call "<New>" the problem is, it keeps staying at the...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
7
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want...
4
by: Laura K | last post by:
I have a drop down menu which has a list of subcategories and the initial value is "please choose a Subcategory". When the user chooses a subcategory they are taken to a new page where the drop...
3
by: Brad Isaacs | last post by:
ASP.NET 2.0 / SQL Server 2000 db / Visual Basic Code behind On my .aspx page I have added an SQL Datasource that contains the SQL query to retrieve the list for my Drop Down List Box. Using...
1
by: jacbyrd | last post by:
I have created a user control that is a drop down list that pulls from my database. I then drop that control into a detailsview control on an insert item template. When I run the insert command,...
0
by: yosri2005 | last post by:
Hello, I'm sure many of you have seen the error message in the subject. I found quiet a few posts on the web regarding this issue, but the ones I saw mainly tackle this issue when you have a...
1
by: student2008 | last post by:
Sorry about the title its a tricky one. I have a form which allows me to add a question and answers into a mysql database via a combination of, if a certain option is chosen and the reset button...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.