Deferred Deletion: How to delete Editable Child object in an Editable Root Collection (List)

Deferred Deletion: How to delete Editable Child object in an Editable Root Collection (List)

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


davidng posted on Thursday, July 22, 2010

Hi everyone,

Please show me how to implemement Deferred Deletion on Editable Child Object.

In VB2008, Rocky did mention how to implement this method on Root object (p. 178), but I could not find the same technique on Child object.

Thanks in advance. 

RockfordLhotka replied on Thursday, July 22, 2010

The only way to delete a child object is through deferred deletion. The child object is typically contained in a BusinessListBase, so you do this:

_myCollection.Remove(myChild)

That marks the child for deletion and removes it from the active list. When you save the root object, that child's Child_DeleteSelf() will be invoked, so you can actually do the delete in the database.

davidng replied on Friday, July 23, 2010

Hi Rocky,

Remove method works very nicely.

Thank you very much for sharing your knowledge.

 

Copyright (c) Marimer LLC