473,394 Members | 1,802 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,394 software developers and data experts.

Add Items From On DropDownList to Another

I am wanting to add all the dropdown items from one dropdown control to
another. I see that there is a method for "AddRange", but it will not accept
the property returned from the other control which returns a
ListItemCollection. I know that I can loop through them and add them one-by
one, but was thinking there must be an easier way.

Thanks in advance for your assistance!!
Nov 18 '05 #1
1 1504
I've been looking for the same easier way as you, but so far looping and
adding items seems to be the only one.

Henri

"Jim Heavey" <Ji*******@discussions.microsoft.com> a écrit dans le message
de news:90**********************************@microsof t.com...
I am wanting to add all the dropdown items from one dropdown control to
another. I see that there is a method for "AddRange", but it will not accept the property returned from the other control which returns a
ListItemCollection. I know that I can loop through them and add them one-by one, but was thinking there must be an easier way.

Thanks in advance for your assistance!!


Nov 18 '05 #2

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

Similar topics

1
by: DC Gringo | last post by:
I'm having such a problem with this DropDownList in a user control that is posting back and throwing an error: System.Web.HttpException: A DropDownList cannot have multiple items selected ...
5
by: Kay | last post by:
Hello, I have two list boxes on my form, one initially displays with items and the other displays blank, by clicking a button, it is possible to move items from one box to another and vice a...
6
by: Oscar | last post by:
I want to add items to a dropdownlist control within a Javascript eventhandler. This is what I code : var dd = document.getElementById("DropDownList1"); dd.Items.Add("1990");...
2
by: Michael | last post by:
Hi again, I really hope that there is a simple solution to this one, cause I'm having simular things happening to other controls on this usercontrol. I have the following control:...
3
by: Kevin Blount | last post by:
I'm using the following code to create a DropDownList based on the contents of a text file, which works. Now I want to add another feature, which is where I need some guidance. On one page I...
3
by: Iain | last post by:
Hi All I have 2 DropDownList boxes on a page. The first (id= "Operation") is populated on PageLoad with the contents of a database table. The second id="WorkStations" will not be populated...
1
by: mark4asp | last post by:
Is it possible to treat values and items of a DropDownList like a HashTable? My page records the value of the ConsultantName in a label lblConsultant and the ID in a hidden field hidConsultantID...
1
by: SubashiniKumaar | last post by:
how to copy dropdownlist selected items to another dropdownlist in Asp.net using C# codings
2
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
1
by: =?Utf-8?B?aUhhdkFRdWVzdGlvbg==?= | last post by:
I have a dropdownlist of width 100px in a webform. When I hit the control, I gets the list of items that I populated in a pageload. My problem is that the items in my dropdown are more in length...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.