Please check out CompanyMaintenance form. It demonstrates IncludeInFormAdd issue. Run "Company" from Mainform.toolbar and click new button.
You had the IncludeInFormAdd property set to True on the Companies,Addresses, and Contacts. You also had the Addresses and contacts ParentBusinessObject property set to companies. In this instance the instantiation order is not controlled and you cannot control which Add() will occur first. The InitializationPriority property is NOT respected here. In your situation, let the Companies Add() be fired through the MaintenanceFormToolstrip. In the AfterAddNew of the Coanies, add a new record to Addresses and Contacts.
Please check out CompanyMaintenance2 form. It demonstrates problem of drop childformdialog on user control. Run "Company2" from Mainform.toolbar and click "Country" linklabel directly.
All you have to do is set the ParentForm property of the ChildFormDialog.
this.CountryAddFormDialog.ParentForm = (MicroFour.StrataFrame.UI.Windows.Forms.BaseForm)this.ParentForm;
if (this.CountryAddFormDialog.ShowDialog() == DialogResult.OK)
{
this.cboCountry.SelectedValue = this.countriesBO.CountryID;
}
So I was right whe I said that you could drop the ChildFormDialog control on the user control. You just have to set the ParentForm property.
Attached is your corrected project.