Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSet
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
00878482
Message ID:
00878777
Vues:
37
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:
/// <summary>
/// Parent Retrieved hook method
/// </summary>
/// <param name="bizObj">Parent business object</param>
/// <param name="e">EventArgs</param>
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)
{
   // code that retrieves the invoices
}
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform