Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having trouble wiht a child grid
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00910957
Message ID:
00911410
Vues:
20
Mike,

>Everything works except that when I add a new parent record, then add new child records without first saving the parent, I get constraint violations in the database. Is there a way I can force the parent record to be written to the db first? Adding new child records to an existing parent works great.

Rather than saving each child row as it's added, you can have a single Save button on the form that saves changes to the parent object. If you register the child business object with the parent business object (see the MM .NET Dev Guide topic "Establishing Business Object Relationships" for details), the parent saves first then the child object is automatically saved afterwards.

>Also, if there is something a little more elegant for setting default values for columns in the new row, I'd love to use it!

There is a better built-in MM .NET way to do this. Check out the MM .NET Dev Guide topic "Setting Default Values in New Rows".

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform