I m using VS2010 with SQL server 2008 at the backend. I m creating a windows application in which I have 2 listboxes.the data is being retrieved from SQL server database in listbox1.i want to select all itms from this listbox1 and add them to listbox2. And remove itms from this listbox2 and add them to listbox1.
samkri
0
Newbie Poster
Recommended Answers
Jump to PostlistBox1.Items.Clear(); // for removing all items foreach(ListItem listItem in listBox1.Items) /* adding items to another listbox*/ { if (listItem.Selected == True) { listBox2.Items.Add(listItem); } }
All 3 Replies
castajiz_2
35
Posting Whiz
ddanbe
2,724
Professional Procrastinator
Featured Poster
Sulaiman_1
-2
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.