DataGridView with BindingSource not updating dataset
I have a DataGridView (dgvEncumbr) that is bound to a business object dataset property (oPO.Encumbrances) by way of a BindingSource (bsEncumbr), as shown below under "Bind DataGridView".
When a user attempts to add a new object (oPO), I am resetting the binding to make sure there is no risidual from an earlier selection. When the user clicks the save button (buttonSavePO), I am updating the BindingSource like so: bsEncumbr.EndEdit().
The trouble is that it will not save the dgv entries until after the oPO object is saved once. When I step through the code, I find that bsEncumbr.EndEdit has the new records from the dataset, but it isn't making it from bsEncumbr to the dataset in the business object. This actually used to work and it stopped. Am I missing some code that will update the business object (dataset) from the BindingSource?
'Bind DataGridViewbsEncumbr.DataSource = oPO.EncumbrancesbsEncumbr.DataMember = "POEncumbrances"dgvEncumbr.DataSource = bsEncumbr'buttonSavePO_ClickbsEncumbr.EndEdit() 'records are present at runtime'code in the business object's Save() methodm_daEncumbr.Update(m_dsEncumbr, "POEncumbrances") 'records are NOT present in the dataset!