refresh control databinding

HeavenCore

Well-known member
Joined
Apr 10, 2007
Messages
77
Location
Bolton, England
Programming Experience
1-3
Hi everyone, hopefully a simple question / answer.

Is there an easy way to refresh a comboboxes databound items?

More info:
i have a databound form, works great, with one of the attributes being a combobox which is also populated by databind items (a list of foreign keys etc)

There is a button next to this combobox which opens a 2nd form where they can edit/add/remove data in the foreign key table. when this form is saved and closed what is an easy weay to refresh the combobox with the latest data without haveing to reload the entire form?
 
in response to my own question (for anyone else if they stumble accorss this thread with the same problem)

i simply re-filled the table adapter

VB.NET:
Me.TblExposureTypeTableAdapter.Fill(Me.DsExposureType.tblExposureType)

As my combobox uses its own datasource and table adapter this does not effect the main form and worked fine :)
 
That will pull new data from the database. If you added new data there, then a Fill must be used. If you added new data to the datatable upon which the combo is based it should automatically update. You can oiptionally call ResetBindings in the BindingSource that the combo binds to, passing a boolean to indicate whether schema+data or data is the change. The relevant events will be fired to update the control. Need for use is rare
 
Back
Top