Create New screen with child and grandchildren RRS feed

  • Question

  • I have three tables in the database and here are their relationships:

    Asset [0..1 to 1] Computer [1 to Many] HardDisk

    I have succeeded in creating a screen that allows user to create an "Asset" and its child "Computer". However, I wanted to add a datagrid of HardDisks that links to Computer. How can I achieve that both for CreateNew and Details screen?

    Sparking Spirit

    Wednesday, March 5, 2014 5:49 AM

All replies

  • In screen designer to the left you will have your 'Computer' property and listed in that should be an item named 'Add HardDisks'. Click on this to add a 'HardDisks' collection property. Add this collection to your screen, likely below the asset/computer details.

    If this is HTML client then add some button(s)/item-click for the in-built HardDisks-AddAndEditNew/EditSelected. If it is Silverlight the datagrid will have these buttons already. 

    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Wednesday, March 5, 2014 10:37 AM
  • Thanks for your reply! However, while it works for child entity, the grandchildren does not appear to work this way i.e. "Add HardDisks" does not appear at all.

    Sparking Spirit

    Thursday, March 6, 2014 1:28 AM
  • Would you mind providing us a screen shot of the screen designer to which you want to add the Harddisks collection?

    Justin Anderson, LightSwitch Development Team

    Thursday, March 6, 2014 9:34 PM