StrataFrame Forum

Business Object 'IsDirty' property

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

By Tim Dol - 6/7/2007

Is there a way to prevent the 'IsDirty' property from being set when you modify a business object?  The SetDirtyOnEdit = False works okay until you actually change the business object.  I have a couple business objects on a form which require some pre-processing and I don't want these to trigger my Save message.

Tim

By Trent L. Taylor - 6/7/2007

The IsDirty property actually looks through the DataTable to see if there are any changes.  To "reset" the IsDirty property all you need to do is reject the changes on the DataTable (or AcceptChanges if you want to keep the data the same within the DataTable but just not write it back to the server).  This will reset the IsDirty flag and you can then have the behavior you are looking for.

FYI....in version 1.6.1 there is now an IsDirtyChanged event that you can handle which will tell you immediately when a value within the internal DataTable has been changed.  This really doesn't matter much to what you were doing, but I know that people have asked for this in the past and I could not remember if you were one of them. Smile

By Tim Dol - 6/7/2007

Exactly what I needed.Smile  Thanks.