Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
HookParentRetrieved() on child firing on NewEntity()
Versions des environnements
Network:
Windows 2008 Server
Hi all,
With a parent/child relationship, when the parent NewEntity() is called it is calling the SetCurrentDataSet() which raises the Retrieved event. the child's HookParentRetrieved() is called with a null primary key because NewEntity doesn't have a PrimaryKey yet. As a temporary fix, I check for the PrimaryKeyValue and PrimaryKeyVaues being null in the Hook method so that it doesn't fire.
My question is, shouldn't the NewEntity() pass a false to the raiseEvents parameter in SetCurrentDataSet()? Currently it uses the overload that doesn't accept the raiseEvents parameter and the overload defaults that parameter to true.
But what do I know, I'm just a rookie at all this. :)
Thanks,
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement