detecting update data from BindingSource Form

Dec 17 2012 11:04 AM
Hi friends. What is the better way to implement a process which detect a change on the data of a BindingSource in order to save the data only if the content of the form data is effectively changed. I'm developing an application using windows forms, so I've been trying to use the "CurrentChange", "CurrentItemChanged" y "ListChanged" events but it doesn´t works as i want. Those Events fires when every single record of the binding source is filled with data. There is another moment when those events fires, which is when I send the content of a bindingsource to an object something like this

MyObjectClass updatedObjectInstance = new MyObjectClass();
            updatedObjectInstance = ((this._view as GUIObject_View).updatedObjectBindingSource.Current) as MyObjectClass;


At this point the events I've described fires again.....

My main objective is detect one time if a binding source has been updated in order to save the data only if this happens, like a "save on exit" confirmation message which is diplayed when you close notepad without save any changes you made, because de original text (or data) it's different of the current text.

All of my problem comes from a funcionality that I must implement in which I've a main Windows Form with many tabs (I'm using "SmartComponents - SmartParts" user controls for each tab), and with only a single click or shortcut key I could save the data of the main form and all of its opened tabs only if each tab there's data changed.

Thanks in advance

Gabriel

P.S. Sorry for my english. I'm writing from Latin America (Ecuador actually)