pass item's from one ListBox to another with DataSource

0

I have the following problem, in an Aspx form with C #, I need to add or delete items to a ListBox from another ListBox, which are selected in one, in both listBox they are fed with DataSource (), I have seen in Internet and the that I could find the items are added with .Items.Add ()

After performing the item's movements I must have a button to record the changes .-

Help is appreciated .-

    
asked by Alberto Maureira 30.08.2016 в 18:41
source

1 answer

0

To implement what you plan you should keep the list that loads the listboxes in the object Session , then operating in memory you can move the items from one list to another

[ASP.NET] - Passing values between two GridView

In the article I implement this that I comment, only that instead of ListBox I use GridView, but the technique that you have to achieve is the same.

  • Retrieve the Session lists
  • Locate the selected value (you can help with linq)
  • Add to the selection list
  • Remove from the source list
  • Assign the DataSource to see the change reflected
answered by 30.08.2016 / 19:03
source