Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:44:30+00:00 2026-05-28T00:44:30+00:00

I have two ListBoxes bound to DataTables. When I try to move information from

  • 0

I have two ListBoxes bound to DataTables. When I try to move information from one ListBox to another listbox using a button click with the following code:

protected void btnAdd_Click(object sender, EventArgs e){
    ListBox1.Items.Add(ListBox2.SelectedItem);
    ListBox2.Items.Remove(ListBox2.SelectedItem);
}

One items is removed from ListBox2 and added to ListBox1 but if I try and click the button again with a newly selected item nothing happens.

I’d like to be able to move up to all the items from listbox 1 into listbox 2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:44:31+00:00Added an answer on May 28, 2026 at 12:44 am

    Keep two datatables, one for each list box. Move the items to their respective datatables and on your button click, rebind the listboxes to the datatables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have two listboxes when I drag One item from the source listbox I
I have two listboxes that I am dragging one item from to the other.
I have two ListBoxes, one inside another. And both ListBoxes will have items dynamically
I have an instance of ObservableCollection bound to a WPF listbox with two separate
I have two ListBoxes, lstAvailableColors and lstSelectedColors. Between each listbox are two buttons, Add
I have a vertical StackPanel with two elements: a Button and a ListBox. How
I have an observable collection bound to a listbox in WPF. One of the
If I have two listboxes, with a button between them, how do I update
I have two listboxes and two buttons. Each listbox is in its own div
I have two listBoxes. The first listbox contains the list of traffic violations. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.