title: Getting Just the ValueMember from ComboBox
body: <p>I have a combobox with I am filling like this:</p>
  
  <pre><code>comboBox1.DataSource = items;
  comboBox1.DisplayMember = "Item";
  comboBox1.ValueMember = "Value";
  </code></pre>
  
  <p>Later I am attempting to get the value like this:</p>
  
  <pre><code>string value = comboBox1.SelectedValue.ToString();
  </code></pre>
  
  <p>I am expecting a string which contains "DFT". What I am getting, however is a string that contains "{ Item = Default Project, Value = DFT }".</p>
  
  <p>Any idea how I can get just the DFT out of there?</p>
  
  <p>Thanks</p>
  
  <p>EDIT: Forgot that it wasn't apparent. Items is a List generated from an XDocument (Linq) using the descendants method. The XML looks like:</p>
  
  <pre><code>&lt;Parent&gt;
    &lt;Item&gt;
      &lt;Name&gt;Default project&lt;/Name&gt;
      &lt;Value&gt;DFT&lt;/Value&gt;
    &lt;/Item&gt;
  &lt;/Parent&gt;
  </code></pre>
  
  <p>EDIT 2: This is my best guess as to the method I used to generate list (its at work and I don't remember it fully):</p>
  
  <pre><code>var items = (from i in xmlDoc.Descendants("item")
                       select new { Item = i.Element("Name").Value, Value = i.Element("Value").Value }).ToList();
  </code></pre>