EditControlShowing not adding items to ComboBox

111 Views Asked by At

I am adding items to my ComboBox (inside a DataGridView) dynamically. When the EditControlShowing event fires I am able to load all the items into the list correctly, but every time I make a selection change only my first item remains in the combo box?

I've also used the Commit method to commit the changes to the dgv but still no luck.

Note: cboItem was a small class object that is re made in a for loop with new values, it is this object that I must add to the combo box.

Here's the code I used to add (Note this is inside EditControlShowing):

 cellComboBox.Items.Add(cboItem)
 dgvEmails.CommitEdit(DataGridViewDataErrorContexts.Commit)
 dgvEmails.SelectedRows(0).Cells("cboFileTo").ValueType = GetType(cboItem)
 dgvEmails.EndEdit()
0

There are 0 best solutions below