Hi all, hope this helps.
Seems that when you add a row, the default value of the combobox cell needs to be identical to one of the items in the list. I have handled this in my particular case by writing an event handler to give the cell a default value on creation.
Private Sub grdEdit_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles grdEdit.DataError If sender.Equals(Me.grdEdit) Then If e.ColumnIndex = 1 Then Me.grdEdit.Rows(e.RowIndex).Cells(1).Value = Me.lstDta.Rows(0).Item(0) End If End If End Sub
lstDta = Data.Datatable object that populated the Items collection of the listbox. I am assuming this method will also work for a databound control. |