Hi,
I have a MDI application. I load a MDI child form with a read-only collection. I jump to another MDI child form to edit the record which is listed in the first form. When I save and close the record edit form. How do I notify the first from to refresh & get updated data? Some sample code will be appreciated.
Thanks
The way I handled this was to create an Editable object in the MDI form that had the collection, create the edit form which had a property object for the item to be edited, pass the object to the form, then show the form in a modal mode. When the form was closed, I returned whether the change was applied (OK button) or canceled.
If the change was applied, I would call the editable objects save function and update the collection appropriately..
Since you are only notifying one object, an observer would be overkill. You really only need a simple callback in this situation. You can do this with interfaces, events or delegates. I typically prefer using interfaces for callbacks.
Copyright (c) Marimer LLC