| | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 1:09:23 PM Posts: 2,686, Visits: 1,888 |
| You wouldn't need to put any code there because the navigation buttons on the MaintenanceFormToolstrip call the Navigate() methods on the business object(s), so the Navigated event is already getting raised (which re-filters the children automatically). The reason you have handle events on the parent grid in your scenario is because of the flat list problem... the grid doesn't need to navigate records, so you have to Navigate the business object manually. With the maintenance form toolstrip, and the way the CustomerMaintenance form works, you have to call Navigate to move to another record.
www.bungie.net |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 07/09/2008 2:20:16 PM Posts: 436, Visits: 944 |
| | | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 1:09:23 PM Posts: 2,686, Visits: 1,888 |
| The error you're getting when trying to insert the child record is because the Titles business object is configured with PrimaryKeyIsAutoIncremented = True, and the primary key can only be auto-incremented for numeric data types. Since the primary key is not an auto-incremented value, you'll need to set the PrimaryKeyIsAutoIncremented property to False and assign a valid PK value for the new child record before saving. Basically, the server cannot assign the PK value, you'll have to assign it on the client side.
www.bungie.net |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 1:09:23 PM Posts: 2,686, Visits: 1,888 |
| As for the child grid not being cleared when you select a record that has no child records, put a handler on the TitlesBO.FilterChanged event and within it, put a message box, or a Debug.WriteLine() call within it and print the TitlesBO.Filter value. Basically, I want to make sure the filter is being set whenever you select a record that doesn't have any child records.
www.bungie.net |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 07/09/2008 2:20:16 PM Posts: 436, Visits: 944 |
| As for the child grid not being cleared when you select a record that has no child records, put a handler on the TitlesBO.FilterChanged event and within it, put a message box, or a Debug.WriteLine() call within it and print the TitlesBO.Filter value. Basically, I want to make sure the filter is being set whenever you select a record that doesn't have any child records.
I'll try that.
Another question. I have the Customer Maintenance form and I have a parent child relationship setup with the Orders table. There is a grid on the maintenance form that displays the customers orders. I have everything setup correctly (i think) and when i run the program there is no errors but the navigation buttons are disabled. The first customer doesnt have any related orders. I dont know if that has anything to do with it. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 1:09:23 PM Posts: 2,686, Visits: 1,888 |
| Make sure that the IncludeInFormNavigateType property on the CustomerMaintenance form is set to PrimaryBusinessObject and make sure that CustomersBO1 is set as the PrimaryBusinessObject on the form. For some reason, it looks like your form thinks it's supposed to be navigating Orders instead of Customers.
www.bungie.net |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 07/09/2008 2:20:16 PM Posts: 436, Visits: 944 |
| I've checked both those things and they were set properly. I turned the ChildAutofilter property off and ran the program and it worked fine. I was able to navigate the customer form and the all the orders filled the grid. When I set ChildAutoFilter to MatchCurrentRow I got the attaced error.
|
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 1:09:23 PM Posts: 2,686, Visits: 1,888 |
| I believe that there is already code within the Navigate method on that form that's requerying the database for the orders. You can either requery like that form is doing, or you can fill the parent and child with all of the necessary records and then let the child filtering do its thing. But, if you try to use both methods, you're going to run into problems.
www.bungie.net |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 07/09/2008 2:20:16 PM Posts: 436, Visits: 944 |
| Sorry, I dont understand. I have the SQL statements in the business objects that will be used to fill them. Then in the form I call those Fill methods in each BO's ParentFormLoading Event. You're saying not to fill the BO's on load?
This thread seems like its taking on a life of its own. |
| | |
|