Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Iterate through Datagrid or mmBindingList
Message
From
07/07/2010 16:27:53
 
 
To
07/07/2010 15:09:17
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01471707
Message ID:
01471735
Views:
36
Hi,

You'll just need a reference to System.Core and a 'using System.Linq;'

>Is this Linq to SQL? What references do I need to add in order to implement this?
>
>Guy
>
>
>>>Hi,
>>>
>>>In VS2010 and MM.NET 4.0, I have populated a WPF Datagrid with a result set passed as a mmBindingList. I want to calculate the total of a numeric column and display it in a separate Textbox on the WPF window. I've googled for some examples but coming up short. I know how to get values from a selected row on a Datagrid. But in this case, a selected row does not apply. Does anyone know how to iterate through the rows of a WPF Datagrid and read/calculate values?
>>>
>>>Or, as an alternative, is there another way to calculate values from the mmBindingList before I hand it to the Datagrid? Any examples or thoughts on the best way to proceed?
>>
>>You don't say what the content of the mmBindingList is but assuming something with a field named 'Amt':
int total = (from x in mymmBindingList select x.Amt).Sum();
will give you the aggregate for the field and you could bind to that.....
Previous
Reply
Map
View

Click here to load this message in the networking platform