title: Setting DataGridViewComboBoxColumn.Valuemember to a list<string>
body: <p>I needed to know if one can set the ValueMember property of a DataGridViewComboBoxColumn directly from a list of strings.</p>
  
  <p>e.g.</p>
  
  <pre><code>List&lt;string&gt; productNames = new List&lt;string&gt;();
  
  List&lt;Products.Product&gt; t = new List&lt;Products.Product&gt;();
  
  foreach (var p in products)
  {
       var x = p.Product;
  
       itemListing = x;
  
       foreach (var pn in x)
       {
           productNames.Add(pn.name);
       }
  }
  .............
  
  // set values to combobox column cells in datagridview
  GridSellProducts.Rows.Add();
  DataGridViewComboBoxColumn cmbItems = (DataGridViewComboBoxColumn)GridSellProducts.Columns["Item"];
  
  cmbItems.DataSource = productNames;
  cmbItems.DisplayMember = cmbItems.ValueMember;
  cmbItems.ValueMember = // code to put here  
  cmbItems.AutoComplete = true;
  </code></pre>
  
  <p>Didn't quite get the example in <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.datasource.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.datasource.aspx</a></p>
  
  <p>How does one set <code>cmbItems.ValueMember</code>?</p>