Editable Master-DetailList-SubDetailList

Editable Master-DetailList-SubDetailList

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


VoodooSV posted on Thursday, November 29, 2007

Hi!
I'm would like to have an editable Order. Each Order can have many editable items - OrderItems, and each OrderItem can have subitems - Assembly.
If  I create next objects-hierarchy, is this correct approach?

Editable Root (Order)
|
--EditableChildList (OrderItems)
   |
   --EditableChild (OrderItem)
      |
      --EditableChildList (Assembly)
         |
         --EditableChild (AssemblyItem)

Thanks!

ayubu replied on Thursday, November 29, 2007

I think the  the hierachy is okay.

It is possible to have a parent with children and also grand grand children.

 

 

Angel replied on Thursday, November 29, 2007

What is the best way to reference parents from childs?

Imagine that i need to acces to a order property from orderitem for check a rule

ayubu replied on Thursday, November 29, 2007

I think form CSLA.NET 2.14 upward there is an IParent interface which enables children to access the parent properties , of course you have to cast appropriately.

Just give a try, myself i have not done so but i think will work out.

Another way out is just using events for example if the id of parent has changed then you may want children to react to the events.

 

Copyright (c) Marimer LLC