Delete

Delete

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


KJosh posted on Tuesday, October 14, 2008

Hi,

1) How to perform the delete of the child from the parent? I have etablished the parent child relationship by keeping the child class as property to the parent class. I know how to perform update on child by calling  the DataPortal.UpdateChild in the parent's dataPortal_Update, Insert. Like this how we perform the child delete?

2) How to apply sorting,Paging on the List object?

Thanks in advance

triplea replied on Wednesday, October 15, 2008

1) In ProjectTracker.Library.ProjectResources.Update()

this.RaiseListChangedEvents = false;

// update (thus deleting) any deleted child objects
foreach (ProjectResource obj in DeletedList)
      
obj.DeleteSelf(project);

// now that they are deleted, remove them from memory too
DeletedList.Clear();

and of coure implement DeleteSelf() in your child.

2) In Windows Forms I would use SortedBindingList<> for sorting.

Copyright (c) Marimer LLC