DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   Copy Items from one combobox to another on Button Click (http://www.daniweb.com/forums/thread123534.html)

sonia sardana May 10th, 2008 11:38 am
Copy Items from one combobox to another on Button Click
 
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.

majestic0110 May 11th, 2008 4:22 pm
Re: Copy Items from one combobox to another on Button Click
 
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:

combobox2.items.add(value)

To this:

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.


All times are GMT -4. The time now is 6:23 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC