edit level mismatch in CopyState for grand child

edit level mismatch in CopyState for grand child

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


fredg posted on Tuesday, March 06, 2012

Hi, i do more investigation on my windows form project. My root object has 1 child, the child has 2 grand children objects.

During loading the windows form, after retrieving root object(no any binding right now),  I did root.BeginEdit(). The 2 grand children has 2 different edit level, i.e. 0 and 1.

Do you have any idea? Is the grand children's problem? Thanks in advance.

JonnyBee replied on Tuesday, March 06, 2012

Could you post the code for us to check/verify the problem?

All the child/grandchild should be on the same EditLevel after BegEdit on the root object.

Is any of the grandchild objects lazy loaded or created by a rule?

fredg replied on Tuesday, March 06, 2012

Thanks for your reply. The code is a bit long.

I did more debug. When calling BeginEdit() on grandchild 0 (which has different edit level from root), get "Expression has been evaluated and has no value" error;  when calling BeginEdit() on grandchild1 (which has same edit level as root), get "Edit level mismatch in CopyState" error.

What do you mean "lazy loaded or created by a rule"? i think grandchild is loaded as its parent.

JonnyBee replied on Tuesday, March 06, 2012

Just trying to find out if both grand children is loaded at the same time in data access or if one may be created from on the client side by a Rule.

Seems like both grandchildren is loaded the data access code (Fetch)?

fredg replied on Wednesday, March 07, 2012

All grand children is loaded at the same time in data access. What do you mean "Seems like both grandchildren is loaded the data access code (Fetch)? "?

fredg replied on Tuesday, March 06, 2012

I tried 3 grandchildren objects, grandchild 0 has different edit level. other 2 objects seems fine.

Copyright (c) Marimer LLC