StrataFrame Forum

TranslateBusinessObjects casts SourceContainer to BaseForm

http://forum.strataframe.net/Topic5303.aspx

By Andria Jensen - 12/14/2006

I am trying to use this routine to translate BO's from a UserControl to a dialog form.  I pass the UserControl as the SourceContainer, but I get an error because in this routine you are casting the SourceContainer to a BaseForm.  Shouldn't you check to see if this is a form before doing this line?  Everything else works with any kind of ContainerControl except this line which isn't needed in that case right?

CType(SourceContainer, BaseForm).RemoveObjectFromInitOnFormLoad(DestinationBusinessObject)

By Trent L. Taylor - 12/14/2006

Actually no...this method is intended for Form use only.  I will look for verification, but this method was written to support the BaseForm translations. 
By Andria Jensen - 12/14/2006

If that's the case you may want to make the types it takes Form types instead of ContainerControl types.   Is there a way I can accomplish the translation going from a UserControl to a Form? 

Will SharedDataTableKey do what I want here?  I have tried to use that feature before and haven't had a lot of luck with it.  I inevitably get an error about the key not being the dictionary when I try to view the form in the designer.