title: Retrieve comboBox displayed values
body: <p>I am trying to retrieve the displayed values of all items present in a <code>comboBox</code>.</p>
  
  <p><strong>First case</strong>: if the comboBox has been filled using a <code>DataSource</code>:   </p>
  
  <pre><code>comboBox.DataSource = myDataSet.Tables[0];
  comboBox.DisplayMember = "value";
  comboBox.ValueMember = "id";
  </code></pre>
  
  <p>...I use this code:</p>
  
  <pre><code>foreach (DataRowView rowView in comboBox.Items) {
      String value = rowView.Row.ItemArray[1].ToString();
      // 1 corresponds to the displayed members
      // Do something with value
  }
  </code></pre>
  
  <p><strong>Second case</strong>: if the comboBox has been filled with the <code>comboBox.Items.Add("blah blah")</code>, I use the same code, except I have to look in the first dimension of the <code>ItemArray</code>:  </p>
  
  <pre><code>foreach (DataRowView rowView in comboBox.Items) {
      String value = rowView.Row.ItemArray[0].ToString();
      // 0 corresponds to the displayed members
      // Do something with value
  }
  </code></pre>
  
  <p>Now I would like to be able to retrieve all values without knowing the scheme used to fill the comboBox. Thus, I don't know if I have to use <code>ItemArray[0]</code> or <code>ItemArray[1]</code>. Is it possible? How could I do that?</p>