title: Programmatically set listbox selected items from comma separated list
body: <p>I'm having issues with setting selected items in a listbox from a comma separated data list.</p>
  
  <p>The comma delimited list has values like this (valueList): <code>A,B,C,D</code></p>
  
  <pre><code>List&lt;string&gt; values = valueList.Split(',').ToList();
  
  foreach(string val in values)
  {
      listBox.SelectedItems.Add(val);
  }
  </code></pre>
  
  <p>Basically I loop through the items in the delimited list and attempt to set the selected items in the listbox (which contains the items <code>A, B, C, D, E, F</code>). With this code, I suspected it would select items <code>A-D</code> in the list box, but it doesn't highlight/select any items.</p>
  
  <p>Any ideas?</p>