title: Bind different entries to DataGridViewComboBoxCell from a data source
body: <p>I have the following data I want to display in a DataGridView:</p>
  
  <pre><code>DataEntry[] data = new[]{
          new DataEntry(){Name = "A", Entries = new []{ "1", "2"}},
          new DataEntry(){Name = "B", Entries = new []{ "1", "2", "3"}}};
  </code></pre>
  
  <p>"Name" will be a simple TextBox field, and "Entries" a ComboBox where the items to choose from are the elements in the list.</p>
  
  <p>So in this example there would be 2 rows (below is what the datagridview would look like):</p>
  
  <pre><code>       Name                         Entries
  
  Row1 :    A                    &lt;choice of "1" or "2"&gt;
  Row1 :    B                    &lt;choice of "1" or "2" or "3"&gt;
  </code></pre>
  
  <p>My question is, how do I bind this data?! I've looked at the DataPropertyName, DisplayMember and ValueMember properties... but just cannot work this one out.</p>
  
  <p>Below is the code as it stands - with a comment where I need to add the magic couple of lines to set the DataSource etc. for the Entries column.</p>
  
  <pre><code>public partial class Form1 : Form
      {
          DataEntry[] data = new[]{
              new DataEntry(){Name = "A", Entries = new []{ "1", "2"}},
              new DataEntry(){Name = "B", Entries = new []{ "1", "2", "3"}}};
  
          public Form1()
          {
              InitializeComponent();
              dataGridView1.AutoGenerateColumns = false;
  
              var nameCol = new DataGridViewTextBoxColumn();
              nameCol.DataPropertyName = "Name";
  
              var entriesCol = new DataGridViewComboBoxColumn();
  
                      //entriesCol. ???? = "Entries"; !!
  
              dataGridView1.Columns.AddRange(new DataGridViewColumn[] { nameCol, entriesCol });
  
              dataGridView1.DataSource = data;   
          }
      }
  
  
      public class DataEntry
      {
          public string Name { get; set; }
          public IEnumerable&lt;string&gt; Entries { get; set; }
      }
  </code></pre>