Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best practice to sum a column in a grid?
Message
De
31/03/2008 17:40:19
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01306907
Message ID:
01307168
Vues:
7
So, for instance, in my GetJobItemsByJobNo BO method, I can just add an iteration loop to sum up line totals after the GetEntityList() call, and store it to a custom class-level property?

public mmBindingList GetJobItemsByJobNo(string JobNo)
{
return this.GetEntityList("GetJobsItemsbyJobNo", this.CreateParameter("@JobNo", JobNo));

//--Calcuate Line item totals ----
//some iteration code here
this.LineItemTotal=total from above iteration

}




Could I use DataTable Compute method on te data table that I found on MSDN:

.NET Framework Class Library
DataTable..::.Compute Method

Computes the given expression on the current rows that pass the filter criteria.

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)




>Matt,
>
>>When I have a result set in a BO that I am displaying in an mmDataGridView, what is the best practice to sum up one of the columns and display the sum in a textbox or label underneath the column?
>>
>>Should I expect to find this in the application framework that I choose, or is it a "roll your own" kind of problem?
>>
>>I am starting out my learning with WinForms, but I want to understand this matter with respect to WPF forms and ASP web pages as well, because I do not yet know which way I am going to build my app.
>
>I recommend doing this in the business object and you can then bind the UI control to that business object property.
>
>Best Regards,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform