Why object's IsDirty always false after make change of it's properties?

Why object's IsDirty always false after make change of it's properties?

Old forum URL: forums.lhotka.net/forums/t/10301.aspx


ddredstar posted on Tuesday, April 26, 2011

Has anybody encountered this situation, properties of object has been changed, but the IsDirty still false,and IsSavable still false too.

i don't know what mistakes i have made, please help me out!

 

 

 

richardb replied on Tuesday, April 26, 2011

Maybe the object you are querying is NOT the one you changed the properties on.  Is this happening when databinding?

I'm assuming you are calling SetProperty.

Try writing some test code.

ddredstar replied on Tuesday, April 26, 2011

Actually, it's a Editable List object that bound to DataGrid, i changed Property values on UI inside the DataGrid.

tmg4340 replied on Tuesday, April 26, 2011

If you've put properties on your actual list object (not the child objects it contains), then that's likely your problem.  Databinding in .NET wasn't originally designed to consider properties on list objects, and I'm pretty sure CSLA list objects don't consider properties on the list object itself when determining its metastate.

If that's something you need, then you'll need to create a parent root object, put your list in that, and put your list-based properties on that parent object.  I think it may also be possible to override some behavior in your CSLA list object to consider your list-object properties, but I'm not 100% sure on that.

If you're saying that changes on your child objects aren't bubbling up to your list, then it sounds like you may have an issue creating your child objects.

HTH

- Scott

ddredstar replied on Tuesday, April 26, 2011

I mean change Properties of child, i think i created the child object incorrectly.

ddredstar replied on Tuesday, April 26, 2011

Resolved!

I really made a huge mistake, i misused LoadProterty in my editable object, which should be GetProperty,Shame myself,Damned!!!

 

Thank you for your help!

Copyright (c) Marimer LLC