Hi guys. I'm having trouble working with a binding source and a few bound controls on a custom control.
I have a few controls (textboxes, comboboxes, etc) that are bound to a binding source via the designer. These controls work as expected when inserting a new item into the database, but I am having trouble viewing an existing DataRow using those same controls. I am filling the dataset using the primary key, which gets the expected row, but I cannot get my controls to show the data associated with the row.
When I debug to check the value of the BindingSource, it does have the correct row in the list of items, and also has the correct item selected as the CurrentItem, but none of the controls on the interface are showing the value of the current row in the binding source. I've tried resetting the bindings and the current item, but no luck. Also the fill statement only returns one row (as expected).
I have a few controls (textboxes, comboboxes, etc) that are bound to a binding source via the designer. These controls work as expected when inserting a new item into the database, but I am having trouble viewing an existing DataRow using those same controls. I am filling the dataset using the primary key, which gets the expected row, but I cannot get my controls to show the data associated with the row.
When I debug to check the value of the BindingSource, it does have the correct row in the list of items, and also has the correct item selected as the CurrentItem, but none of the controls on the interface are showing the value of the current row in the binding source. I've tried resetting the bindings and the current item, but no luck. Also the fill statement only returns one row (as expected).
Code:
Private Sub populateEdit(ByRef intakeID As Integer)
IntakeTblTableAdapter.FillByIntakeID(AFDiscoveryDataSet.IntakeTbl, intakeID)
BindingSource1.MoveFirst()
End Sub