title: How To Add A DataGridViewComboBoxCell to a Bound DataGridView DataSource (Programatically)
body: <h2>Goal</h2>
  
  <p>I want to have a DataGridViewComboBoxCell after setting my DataGridView's DataSource with a DataView.</p>
  
  <p><img src="https://i.stack.imgur.com/x2ZGL.png" alt="DataGridView Goal"></p>
  
  <hr>
  
  <h2>Current Situation</h2>
  
  <p>I have a DataTable that is populated with <code>BillDetails</code> as the user navigates through his <code>Bills</code>.</p>
  
  <p>I created a DataView and set the DataView's Table to equal to the DataTable of Bill Details. I then set the DataGridView's DataSource to the DataView.</p>
  
  <p><strong>Setting the DataGridView's DataSource</strong></p>
  
  <pre><code>Dim ViewContent As New DataView
  ViewContent.Table = dsBillMat.Tables("dtBillDetails") 'Set the DataTable to my DataView's Table
  ViewContent.RowFilter = "FK_BillHeader = '" &amp; Bill.PK_BillHeader &amp; "'" 'Filter the tables to get the correct Details for the corresponding Bill
  dgvArticles.DataSource = ViewContent
  FormatContentGridView() 'Formats the DataGridView Headers, Visible columns, etc.
  </code></pre>
  
  <p><strong>FormatContentGridView</strong></p>
  
  <p>Code to format my DataGridView. Probably where I would need to add code for my ComboBoxCell?</p>
  
  <pre><code>Private Sub FormatContentGridView()
      With dgvArticles
          'Hide columns
          .Columns("PK_BillDetail").Visible = False
          .Columns("FK_BillHeader").Visible = False
  
          'Header text
          .Columns("ILNum").HeaderText = "# IL"
          .Columns("ArtNum").HeaderText = "# Article"
          .Columns("Description").HeaderText = "Description"
          .Columns("PartNum").HeaderText = "# Pièce"
          .Columns("Quantity").HeaderText = "Qté."
          .Columns("Manufacturer").HeaderText = "Manufacturier"
          .Columns("ShippedLose").HeaderText = "Sép."
          .Columns("OnHand").HeaderText = "En Main"
          .Columns("RSPL").HeaderText = "RSPL"
          .Columns("Code").HeaderText = "Code"
          .Columns("Cost").HeaderText = "Coût ($)"
  
          'Widths
          .Columns("Description").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
          .Columns("Description").MinimumWidth = 150
  
          For Each c As DataGridViewColumn In dgvArticles.Columns
              If c.Visible And c.AutoSizeMode &lt;&gt; DataGridViewAutoSizeColumnMode.Fill Then
                  c.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
              End If
          Next
  
          'Display Index
          .Columns("ILNum").DisplayIndex = 0
          .Columns("ArtNum").DisplayIndex = 1
          .Columns("Description").DisplayIndex = 2
          .Columns("PartNum").DisplayIndex = 3
          .Columns("Quantity").DisplayIndex = 4
          .Columns("Manufacturer").DisplayIndex = 5
          .Columns("ShippedLose").DisplayIndex = 6
          .Columns("OnHand").DisplayIndex = 7
          .Columns("RSPL").DisplayIndex = 8
          .Columns("Code").DisplayIndex = 9
          .Columns("Cost").DisplayIndex = 10
      End With
  End Sub
  </code></pre>
  
  <p>This works great, the information is populated succesfully. I just don't have my ComboBoxCell yet. </p>
  
  <p><img src="https://i.stack.imgur.com/7EvAN.png" alt="Successful DataGridView Display"></p>
  
  <hr>
  
  <h2>Problem</h2>
  
  <p>My issue is, I must have a DataGridViewComboBoxCell for the Code column (red rectangle above). How do I set a DataGridViewComboBoxCell when the column is already created with the DataSource's DataView?</p>