Data Binding to a Collection of Objects
I've bound a load of controls to a collection I've created and the navigation of this is working fine. However, I have an 'add new' option that clears out the current set of data by resetting the collection (oDeliveries = New Deliveries). I add a new item to this collection, but the old data is still displayed - it would seem that the binderymanager/currency manager is still locked to the old data.
I've tried resetting the binderymanager to the bindingcontext of the form, this didn't work.
I also tried clearing the databindings of all objects (txtbox1.databindings.clear) then re-adding them (txtbox1.databindings.add). This method errors as soon as you try to add a new element with "Object reference not set to an instance of an object." I've checked my collection and this has the new object in it, so it must be the databindings object. Help!
|