Theo,
>I have a data grid on that contains two fields in which I want the child data grid to read and present the items that match those fields. I have built my form in the same manner as the example in the Jump-Start, and I have used the this.PrimaryKeys in the constructor of my business object. The problem is that I get a result that only looks at one of the two values.
>
>Example:
>Parent data grid contains a row that has the following two fields:
> - CustomerID and
> - CurrencyID
>I want the child data grid to return all invoices for the CustomerID and CurrencyID.
>
>When I run my application I get all of the records that match CustomerID, but not CurrencyID.
If you've got things set up similarly to the Jump Start application, then in your child business object's HookParentRetrieved method, you need to look at BOTH values in the e.PrimaryKeyValues string array property and use these to retrieve the records you're interested in. For example:
protected override void HookParentRetrieved(mmBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
{
this.GetInvoicesByCustomerAndCurrencyID(e.PrimaryKeyValues[0], e.PrimaryKeyValues[1]);
}
And your GetInvoicesByCustomerAndCurrencyID (or whatever you call it) method needs to accept these two parameters and use them to retrieve just the invoices you're interested in. For example:
public DataSet GetInvoicesByCustomerAndCurrencyID(int customerID, int currencyID)
{
}
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com