EditLevel change when binding a child object to a bindingdatasource

EditLevel change when binding a child object to a bindingdatasource

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


mike7 posted on Wednesday, April 09, 2008

Hi,

I have some problem with the editlevel of my parent object. Each time I try to bind a child object to a bindingdatasource the editlevel is modified. It seems that the object makes a copy of itself or calls "BeginEdit()" in background. After this, my parent object has a level of 0 but my child has a level of 1 then I can't call parent.Save(), it gives me an error (Edit level mismatch in CopyState).

Is there a way to avoid the modification of the editlevel when assigning a child object to a datasource ?

Thank you,

dlabar replied on Tuesday, April 15, 2008

No there isn't.  The solution to this is to call end edit on the binding source.

You can look at this post for more detail:

http://www.lhotka.net/Article.aspx?id=91e15def-fa1c-4236-86b5-b204bfc4a0aa

Copyright (c) Marimer LLC