title: Converting Column in DataGridView into a ComboBox
body: <p>I have a WinForms application written in C# in which I have a DataGridView bound to a DataSource populated from a SQL Database.</p>
  
  <p>My code is as follows -</p>
  
  <pre><code>string sqlText = "SELECT columns FROM table;";
  SqlCommand sqlCom = new SqlCommand(sqlText);
  DataTable table = new DataTable();
  SqlConnection linkToDB = DatabaseConnection();
  sqlCom.Connection = linkToDB;
  linkToDB.Open();
  using (linkToDB)
  using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCom))
  {
      adapter.Fill(table);
  }     
  dataMyGridView.DataSource = table;
  </code></pre>
  
  <p>I have tried to add a DataGridViewComboBox to this as follows -</p>
  
  <pre><code>DataGridViewComboBoxColumn colBox = new DataGridViewComboBoxColumn();
  colBox.DataSource = GetListOfValues();   
  dataMyGridView.Columns.Add(colbox);
  </code></pre>
  
  <p>Now this works, but it adds an entirely new column with the ComboBox, rather than converting one of the existing columns into a ComboBox.</p>
  
  <p>Can anyone explain how I convert an existing Column in the dataMyGridView into a ComboBox?</p>
  
  <p>The GetListOfValues function simply returns a DataTable containing all the possible values for the ComboBox field.  It populates correctly, but like I said, its an entirely new column.  How do I refer the added ComboBox to the relevant property in 'table'.</p>