StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


123»»»

Tutorial 14 (Configuring a Business Object...Expand / Collapse
Author
Message
Posted 04/27/2006 3:26:25 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
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.
Post #980
Posted 04/27/2006 5:02:02 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
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...)?


www.bungie.net
Post #981
Posted 04/27/2006 6:04:29 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
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).
Post #982
Posted 04/27/2006 9:29:16 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
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.


www.bungie.net
Post #987
Posted 04/28/2006 8:02:34 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
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

  Post Attachments 
Grid.jpg (47 views, 57.43 KB)
Post #991
Posted 04/28/2006 8:15:33 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 4:50:35 PM
Posts: 4,796, Visits: 4,766
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

Hope this helps.

Post #992
Posted 04/28/2006 8:24:24 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Yes Trent it did help. I'm getting closer.

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?
Post #993
Posted 04/28/2006 8:43:28 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
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


www.bungie.net
Post #994
Posted 04/28/2006 9:35:48 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
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?
Post #995