title: How do i show enum values in a combo-box?
body: <p>How do i show enum values in a combo-box? The code below result in the combobox having all displayed names being "caseHandler.cState". I wanted it to have the actual names of the enum values.</p>
  
  <p>My enum is defined as follows:</p>
  
  <pre><code>public enum caseState
  {
      Active = 1,
      Finished,
      Problem
  }
  </code></pre>
  
  <p>I have a class that is defined as this:</p>
  
  <pre><code>public class cState
  {    
      public string _name;
      public int _id;
  
      public cState(int id,string name)
      {
          _name = name;
          _id = id;
      }
  }
  </code></pre>
  
  <p>And the code for populating my combobox:</p>
  
  <pre><code>ArrayList AL = new ArrayList();
  
  foreach (string cs in Enum.GetNames(typeof(caseState)))
  {
      cState aEnum = new cState((int)Enum.Parse(typeof(caseState),cs),cs);
      AL.Add(aEnum);
  }
  
  
  cbState.DisplayMember = "_name";
  cbState.ValueMember = "_id";
  
  cbState.DataSource = AL;
  </code></pre>