Hello,
I'm simply trying to keep track of changes on a windows form as users modify control values. I created a boolean variable called IsDirty and want it set to true whenever the user changes something.
The problem is: where to set IsDirty to true?
If I raise the event on "TextChange d" event of a control (let say a textbox), it is set to true whenever the user changes current record.
I also tried to raise it on "Validating " event but then, as soon as I enter a control and leave it, IsDirty is set to true even if the user haven't made any changes.
This was very easy with the DatagridView control since I could add the code to the OnCellEndEdit event.
I bet there's a much easyier way to look for a "row dirtiness" directly on the form (maybe through the bindingsource?) .
Any advice?
Thanks a lot,
Justin
I'm simply trying to keep track of changes on a windows form as users modify control values. I created a boolean variable called IsDirty and want it set to true whenever the user changes something.
The problem is: where to set IsDirty to true?
If I raise the event on "TextChange d" event of a control (let say a textbox), it is set to true whenever the user changes current record.
I also tried to raise it on "Validating " event but then, as soon as I enter a control and leave it, IsDirty is set to true even if the user haven't made any changes.
This was very easy with the DatagridView control since I could add the code to the OnCellEndEdit event.
I bet there's a much easyier way to look for a "row dirtiness" directly on the form (maybe through the bindingsource?) .
Any advice?
Thanks a lot,
Justin
Comment