Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent/child BOs and DataGridViews
Message
From
29/03/2008 06:57:38
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01306066
Message ID:
01306685
Views:
6
OK. I got all that set up, and it is working when I first fire this.Customer.GetCustWithActiveJobs() to populate the parent BO and parent grid, which also populates the child BO and child grid. It is starting out with the first record in the parent BO, and the related child records. All is good, so far...

But, when I click on a different row in the parent grid, nothing happens. Apparently the grid row is not causing any action to move the current row in the parent BO.

I'm sure that I am missing some small detail.





>>I have a BO for customers and a BO for jobs. The Customer BO uses a Stored Proc to get all customers who currently have an active job, and the BO is assigned to the BindingSource for an mmDataGridViewCustomers.
>>
>>Now, I have another grid, mmDataGridViewOrders, that I want to display the job records for the selected row in the mmDatGridViewCustomers. There is a GetOrdersByCustomer() method in the Jobs BO that I can call and pass a CustNo to it the retrieve the records, so I think I have all the rights things in place.
>>
>>I just need to know exactly how to make the "child" grid update to show the results for the selected row of the "parent" grid as the user picks a row in the mmDataGridViewCustomers.
>>
>>I've tried to use "RegisterPrimaryBizObj" and "RegisterChildBizObj" to establish a "relationship" between the to BO's, but I may not have everything properly in place for that yet.
>>
>>
>>What am I missing? Do I need an event handler on the "parent" grid, if so, which event, and how will I be able to read the CustNo of the selected row, so I can refresh the Jobs BO?
>
>In addition to registeing the Job object as a child of the Customer object, you need to add code to the child business object's HookParentRetrieved() method that calls the appropriate method on the child business object.
>
>For an example of this, check out the MM .NET Dev Guide Windows Forms Jump Start topic "Step 11 - Relating the Order and OrderDetail Objects".
>
>Best Regards,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform