StrataFrame Forum

How to configure BOs not to chage "isDirty" to true even if user makes changes

http://forum.strataframe.net/Topic27692.aspx

By Leonard P. - 7/19/2010

Hi,

I need to give users ability to change values in some controls databinded to certain BOs , but I don't want to save those changes to the database. I set all the properties IncludeInFormEdit, IncludeInFormSave, etc to false, as well as SetDirtyOnEdit. Save button is disabled when users make changes to these BOs, but when form is being colsed "Save Changes" messagebox still comes up.



Is there a way to turn off IsDirty change? I could just call RejectChanges() before form closes, I am just wondering if there's a property or something built into the framework that would let me do that.



Thanks
By Ivan George Borges - 7/19/2010

Hi Leonard.

I guess you would have to set the form's AutoShowSaveChangesMessage to False and deal with saving the BOs contents yourself when closing. Otherwise, if you enter into Edit mode, the save message will be shown regardless the BO state.

By Larry Caylor - 7/19/2010

The simplest solution I have found is to either set the form’s AutoShowSaveChangeMessage = False or call the BOs Undo or RejectChanges method in the form’s FormClosing event. 

-Larry