Add to table doesn't update combobox

  • Thread starter Thread starter Joseph Byrns
  • Start date Start date
J

Joseph Byrns

I have a combobox to which I set the source/valuemember/display member to
the appropriate parts of a datatable. When I add a new row to the datatable
no new entry appears in the combo box (while other bound controls update
properly) :

''databind the combo
RowSelectorCB.DataSource = dboCE.Table
RowSelectorCB.DisplayMember = "DisplayMember"
RowSelectorCB.ValueMember = "DisplayMember"

''adding a new row:
Dim NewR As DataRow = dboCE.Table.NewRow
NewR("DisplayMember") = "New Row: " & MaxNewRows.ToString
MaxNewRows += 1
NewR.EndEdit()
dboCE.Table.Rows.Add(NewR)

I've also tried a RowSelectorCB.update(), but still no luck.

Anyone have any ideas?
 
This is a bug/issue in the .NETCF v1.0 ComboBox - it doesn't react to
changes from a source which implements IBindingList. There is some code
here:-
http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=dd0fe46e-dd82-428c-9982-323ef182f25c
To work around the problem, it involves creating a new control derived from
ComboBox so you'll have to work around the fact it has no inherent designer
support though you could build a designer assembly for it. The next SDF will
have this control included.

Peter
 
Back
Top