This is really stumping me?? I have a C1 flexgrid bound to a Supplier object via a databinding source. I have a collection of SupplierContacts in the object and in the Supplier object. One of the fields of the SupplierContact object is boolean marked 'DefaultShipping'.
The flexgrid is bound to the SupplierContacts list and shows addresses plus the DefaultShipping as a checkbox. I need to enforce one rule for DefaultShipping - there must always be one and only one DefaultShipping checked in the list at one time. To achieve this rule, I wrote a loop in the 'set' part of the DefaultShipping that would reset other contacts if this particular contact had DefaultShipping set to true.
When I test it in the flexgrid, the property is called and the value is being set correctly and being marked 'Dirty' (and I can see this in a 'watch'), however, after PropertyChanged as been called, the 'IsDirty' is reset to false and hence I cannot save?? I am using the latest version of CSLA 2 from Rocky's CVS.
Any ideas why this property won't stay dirty - I have not events etc attached,
Thanks
Bonio
As a follow-up, I think I have pinpointed the problem area:
When I initially load the form, I can edit the checkboxes on the flexgrid and the IsDirty flag is set and I can save. Following this first save though, the IsDirty flag is set when I change a checkbox but it appears to be reset prior to a save.
I have two flexgrids on the form - a SupplierContacts and a SupplierContactPhone (1:many rel). I have three databinding sources - the main SupplierEO one, one for SupplierContactList and one for SupplierContactPhoneList.
I use the Clone before Save method shown in Rocky's book - I have found that if I remove the clone bit and just save the object, there is no problem with the IsDirty flag (although I get an error with timestamps in my stored proc :( ) . If I use the Clone method, the IsDirty problem seems start after the first save on the object.
I will now proceed to bang my head against a wall until I find an answer :s
Bonio
Hi Rocky,
Thanks for the reply.
How can I prevent the databinding calling CancelEdit??
Thanks again
Bonio
Copyright (c) Marimer LLC