If I have two lists, with a button between them, how can I update ListBox2 items if ListBox2 items are database binding?
<asp:ListBox runat="server" ID="ListBox1" DataSourceID="DataSource1"
DataTextField="Name" DataValueField="ID" SelectionMode="Multiple" />
<asp:Button runat="server" ID="addButton" onClick="addButton_Click" />
<asp:ListBox runat="server" ID="ListBox2" DataSourceID="DataSource2"
DataTextField="Name" DataValueField="ID" SelectionMode="Multiple" />
Also, if I use SelectionMode = "Multiple", can I update the DataSource with UpdateCommand, which takes one item at a time?
EDIT:
Good to add some clarification:
- Both lists are a DataBound for unique data (SqlDataSource).
- I want to add items from ListBox1 to ListBox2 and vice versa when the user clicks a button.
- I want to be able to add multiple items to a ListBox (suppose multiple selection is enabled)
- I want to call UpdateCommand in a DataSource.
, , - listBox DataCource UpdateCommand SqlDataSource.Update(). , , , . , , - DataSource ListBox , Bind/Update .