Tutorial 14 (Configuring a Business Object relationship)


Author
Message
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
I just finished tutorial 14, Configuring a Business Object relationship, and when i got to the end it said "Designing a child form that will show use of a business object relationship is beyond the scope of this tutorial". Well I've looked through the help file and the forums and can't find a parent-child tutorial.



So my question is how do i create a form with two grids on it to demonstrate how this business object relationship works.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Mike,



Do you want to have a child form that pops up and shows a child grid, or do you want to put both grids on the same form (or maybe on different tabs...)?
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
If you could instruct me on samples of both that would be great!  Both a child form that pops up and a parent child on the same form (two data grids).
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Well, Mike,



The ChildFormDialog is used when you want to show a child form:



1) Drop one on a form

2) Set it's ChildForm property to the type of child form that it should show

3) Set the BusinessObjectTranslations property through the editor and tell it which business objects on the main form should translate into business objects on the child form.

4) Within code, call ChildFormDialog.ShowDialog() to show the child form. The business objects configured in the BusinessObjectTranslations will be translated so that the instances on the main form are the same instances that are on the child form.



When you want to use 2 grids on the same form, you simply place both grids on the form, set the DataSource on one as the parent business object and the DataSource on the other as the child business object. Within the Navigated event of the parent business object, you can repopulate the child business object so that is shows the child records of the selected business object within the parent grid. Or you can set the ChildAutoFilterOption (AutoChildFilterOption?) on the parent business object to MatchCurrentRow and the parent business object will set the filter on the child business object so that only child records of the currently selected row within the parent grid are visible within the child grid.
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944


I've created the business object, added a Standard SF form and dropped a DataGridView onto it. I've set the datasource on the grid to the business object. Couple of questions though... why am i gettng all these weird column names in my grid? (See attached screen shot).



Also when I run the form it only displays one record not all of them... and the SQL statement in the BO is SELECT * FROM Authors.



Thanks
Attachments
Grid.jpg (197 views, 57.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Mike,

To show all rows in the BO, set the IsListSource property on the business object to True.  To remove the other fields, you can edit the columns and remove them.  As to why they show has to do with use using properties as strong-tped fields.  I will look into and see if there is a way for use to dynaimcally remove the others, but at least there is a work around for now Smile

Hope this helps.

StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
Yes Trent it did help. Wink I'm getting closer. BigGrin



Ben had posted this earlier and I'm not sure what he meant by this:



4) Within code, call ChildFormDialog.ShowDialog() to show the child form. The business objects configured in the BusinessObjectTranslations will be translated so that the instances on the main form are the same instances that are on the child form.




Where within code am I supposed to put the ShowDialog line? What if i wanted the child form to pop-up on double click of a row?
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you wanted the form to show in the double-click of a row, then you would add a handler to the grid's double-click event and place the code in there.



Private Sub DataGridView1_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)

'-- Call the child form

Me.MyChildFormDialog.ShowDialog()

End Sub
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
Ok, on one form i have two grids and i have everything setup correctly, i think, i have both grids filling with data... but when i move between rows on the parent grid the child grid isnt synching... Any ideas?
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
What data are you pulling in?



Are you pulling a set of parent records and then also pulling in all of the child records for those parent records?
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