title: Dropdown binding in WinForms
body: <p>Imagine these two classes:</p>
  
  <pre><code>class Part
  {
   public string Name { get; set;}
   public int Id { get; set; }
  }
  
  class MainClass
  {
   public Part APart { get; set;}
  }
  </code></pre>
  
  <p>How can I bind MainClass to a combo box on a WinForm, so it displays Part.Name (<code>DisplayMember = "Name";</code>) and the selected item of the combo sets the APart property of the MainClass without the need to handle any events on the dropdown.</p>
  
  <p>As far as I know, setting ValueMember of the ComboBox to "Id" means that it will try to set APart to a number (Id) which is not right.</p>
  
  <p>Hope this is clear enough!</p>