Business Objects - User Controls


Author
Message
Tim Dol
Tim Dol
StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Trent helped me out a month or so ago with Business Objects and User Controls and things are working fine but I have came accross another issue which I can't seem to resolve.  Here is my scenerio

I have a 'Contact' user control that contains a Grid, Contact Business Object and Business Binding Source. I drop the same Contact BO on my form along with my Contact User control and set the BO Translation property.  I populate the Contact BO on my form and set the Usercontrol's bbs.businessOject =  my forms Contact BO.  THis works fine thanks to Trent.

Now that I have a list of contacts I need the ability to edit contact infomation, without using a child dialog control, so I created a child form to edit contact information.  Now how do I translate the BO from my user control to my dialog form and keep the business objects in sync. I tried setting up a manual business object translation between the two but couldn't figure out how to populate the BO on the dialog form.

Thanks

Tim

StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You should be able to drop the ChildFormDialog on the UserControl itself (in it's designer) and call it's ShowDialog from the form like this:

Me.userControl1.childFormDialog1.ShowDialog()

When you drop it on the UserControl, you should be able to set the translations between the user control and the child form dialog.

Tim Dol
Tim Dol
StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
I tried that.

When you drop a ChildFormDialog on a SF user control you receive an error message 'Invalid FrameWork Container, the object that the ChildFormDialog has been dropped on is not a subclass of MicroFour.StrataFrame.UI.Windows.Forms.BaseForm'. 

Tim

Paul Chase
Paul Chase
Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)Advanced StrataFrame User (594 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Tim,

I had the same issue you just need to forget about drag and drop and set it in code. Here is code out of my contacts user control that I use to pop up a maint form for additional editing. Anyways hope it helps

P 

Private WithEvents ChildFormDialog As MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog

Private Sub ContactUserControl_ParentFormLoading() Handles Me.ParentFormLoading

Me.ChildFormDialog = New MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog

Dim TranslationItem As New MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslationItem

'-Configure Translation

TranslationItem.DestinationBusinessObject = "FrmAddress._BoContacts1"

TranslationItem.SourceBusinessObject = Me.BOTranslations(0).SourceBusinessObject

'-Add to Child Form Dialog

Me.ChildFormDialog.BusinessObjectTranslations.AddRange(New MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslationItem() {TranslationItem})

Me.ChildFormDialog.ChildForm = "ActionLabor.Payroll.UI.Forms.FrmContactMaintenance"

Me.ChildFormDialog.ParentForm = Me.ParentForm

 

''' <summary>

''' Handles the Maintenance Button Clicked Event from The ToolBar

''' </summary>

''' <remarks></remarks>

Private Sub MaintBtnClicked()

If Not Me.ChildFormDialog Is Nothing Then

Me.ChildFormDialog.ShowDialog()

End If

End Sub


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search