Copy Items from one combobox to another on Button Click

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
Reply

Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Copy Items from one combobox to another on Button Click

 
0
  #1
May 10th, 2008
In Vb.net,
I do it in the foll. way--

Dim value as string
Button_Click
For each value in combobox1.items
combobox2.items.add(value)
Next

But it is not working in ASP.net.
Plz de reply back.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,293
Reputation: majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about 
Solved Threads: 67
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Nearly a Posting Virtuoso

Re: Copy Items from one combobox to another on Button Click

 
0
  #2
May 11th, 2008
I am not entirely sure if this will work as I am not experienced in VB at all (or combo boxes for that matter!):

Try changing this line:

  1. combobox2.items.add(value)

To this:

  1. comboBox1.Items.Add(new Item(value));

This idea came as a result of some searches on google I made. Here is the original post (it might help if my fix doesn't work)
I hope this helps, let us know how it goes.
Last edited by majestic0110; May 11th, 2008 at 4:23 pm. Reason: Added URL
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC