|
My main form, frmMain, has a combo box whose datasource is a BindingSource, which is bound to a single-column table called tblNames in a dataset called peopleDataSet. frmMain has a button that opens a 2nd form allowing the user to edit the table underlying the combo box. This second form, frmEdit, has a DataGridView bound to another BindingSource which is bound to tblNames (the same as with the BindingSource on frmMain). The DataGridView allows the user to add, edit, or delete rows from tblNames.
I want changes made to tblNames in frmEdit to be reflected in the combo box on frmMain. So to test out how to do this, after consulting a few other threads on this forum, I simply put a button on frmMain to update the data source of the combo box, which I would click after editing the table in frmEdit. This button runs just one line of code:
this.tblNamesBindingSource.ResetBindings(false);
After trying many times, this does NOT cause the combo box items to be updated. I know the underlying table is being changed because if I close and restart the application, the changes previously made are reflected in the combo box. But, obviously, I want the combo box to update without restarting the app.
(I tried all kinds of other stuff too, like calling Update on the TableAdapter, calling Update on the combo box, calling Refresh on both frmMain and the combo box, etc., etc. ...and NOTHING I've done seems to make the combo box update its items except for restarting the application.)
Any input would be greatly appreciated.
Thanks!
|