title: Match the value of ComboBox inside a DataGridView to another cell
body: <p>I have a <code>DataGridView</code> with a <code>ComboBox</code> column.
  The ComboBox gets filled with a specific list of names and they are identical for every row in the <code>DataGridView</code>.</p>
  
  <p>After I fill my <code>DataGridView</code>, I would like to do the following: </p>
  
  <p>I want every Combo’s value to be set to the corresponding row’s “Table Columns” value, if exists.</p>
  
  <p><a href="https://i.stack.imgur.com/OwaL0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OwaL0.png" alt="enter image description here"></a></p>
  
  <p>I.e. in the picture above I want the value of the first Combo to be “id” (if it contains an item named “id”), the second to be “firstname”, etc.</p>
  
  <p>If the value is not found, it should not select any value in the <code>ComboBox</code>.</p>
  
  <p><strong>Update</strong>: My current code that is not working</p>
  
  <pre><code>private void Mappings_Load(object sender, EventArgs e)
  {       
      dgv.DataSource = tableColumns.Select(x =&gt; new { Value = x }).ToList();
      dgv.Columns[0].HeaderText = "Table Columns";
      DataGridViewComboBoxColumn comboColumn = new DataGridViewComboBoxColumn();
      comboColumn.HeaderText = "File Columns";
      foreach (var item in fileColumns)
          comboColumn.Items.Add(item);
      dgv.Columns.Add(comboColumn);
      foreach(DataGridViewRow row in dgv.Rows)
      {
          string tableColumnValue = row.Cells[0].Value.ToString();
          row.Cells[0].Value = tableColumnValue;           
      }
  }
  </code></pre>