I have two data lists. The first shows only those objects that have been assigned to my product. The second list shows all available items. What I want to do is select all the items in list 2, which contains the list.
For example:
ListBox1-
Item 1
Item 3
ListBox2-
Item 1 (selected)
Item 2
Item 3 (selected)
The code I have is:
List<string> myList = new List<string>();
foreach(ListItem f in ListBoxSourceDetail.Items)
{
myList.Add(f.Value);
}
myList.ForEach(delegate(string n)
{
ListBoxSourceEdit.SelectedValue = n;
});
source
share