General information
Category:
The Mere Mortals .NET Framework
Title:
HookParentRetrieved() on child firing on NewEntity()
Environment versions
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,
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only