select multiple items in asp.net listbox from code
<p>I have two databound listboxes. The first only shows items that have been assigned to my product. The second listbox shows all available items. What I want to do is select all of the items in listbox 2 that list box one contains.</p>

<p>For example:<br />
ListBox1-<br />
Item 1<br />
Item 3<br/><br />
ListBox2-<br />
Item 1 (Selected)<br />
Item 2<br />
Item 3 (Selected)<br /></p>

<p>Code I have:</p>

<pre><code>List&lt;string&gt; myList = new List&lt;string&gt;();
            foreach(ListItem f in ListBoxSourceDetail.Items)
            {
                myList.Add(f.Value);
            }
            myList.ForEach(delegate(string n)
            {
                ListBoxSourceEdit.SelectedValue = n;
            });
</code></pre>
