title: DataGridViewComboBoxCell in an unbound DataGridView WinForm control
body: <p>I am new to the DataGridView WinForm control and just do not like data Binding. I Used to use Spread OCX back 100 years ago and found it friendly. Now I am running into a problem try to do something simple:</p>
  
  <p>I have a grid with two columns:
  1) Name
  2) Status</p>
  
  <p>I want to loop through my collection of "ChinaVisas" and display the applicant's name and the status of his application. I want to make the status column a drop drop that can allow the user to change the value by selecting a different item in the drop down list.</p>
  
  <p>Here's what I am doing. I have a feeling that this isn't the data binding way that most people would code it, but here ya go:  </p>
  
  <pre><code>Private Sub PopulateGridVisa()
  
      grdVisa.Rows.Add(_Order.ChinaVisas.Count)
  
      For r As Integer = 0 To _Order.ChinaVisas.Count - 1
  
          Dim CurrentChinaVisa As ChinaVisa = _Order.ChinaVisas(r)
  
          For c As Integer = 0 To grdVisa.Columns.Count - 1
  
              Select Case c
  
                  Case 0
                      Dim CurrentCell As DataGridViewCell = grdVisa.Rows(r).Cells(c)
                      CurrentCell.Value = CurrentChinaVisa.SortName
  
                  Case 1
  
                      Dim CurrentCell As DataGridViewComboBoxCell = CType(grdVisa.Rows(r).Cells(c), DataGridViewComboBoxCell)
  
                      For Each StatusCode As StatusCode In _frmMain.ApplicationStartup.StatusCodes
                          If StatusCode.StatusCodeId &gt;= StatusCodeEnum.WaitingToReceive Then
                              CurrentCell.Items.Add(StatusCode)
                          End If
                          If StatusCode.StatusCodeId = CurrentChinaVisa.StatusCodeId Then
                              CurrentCell.Value = StatusCode
                          End If
                      Next
  
  
              End Select
  
          Next
  
      Next
  
  End Sub
  </code></pre>
  
  <p>That seems to work, but when the user selects a new status value from the drop down, the following error is returned:</p>
  
  <pre><code>---------------------------
  DataGridView Default Error Dialog
  ---------------------------
  The following exception occurred in the DataGridView:
  
  
  
  System.ArgumentException: DataGridViewComboBoxCell value is not valid.
  
  
  
  To replace this default dialog please handle the DataError event.
  ---------------------------
  OK   
  ---------------------------
  </code></pre>
  
  <p>Why?</p>