Click here to Skip to main content
15,896,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am using VB.NET and WPF.

In a WPF window, I am showing a DataGrid in the Load event. In the Load event itself, I need to count the grand total amount from a single DataGrid column and add it to a textbox in the same page.

My page looks like this:

MY DATAGRID

   Item          Quantity       Total 
   ``````        ````````       `````
   Shirt            2           200
   Pant             1           500
   Tie              -            -
   Belt             2           100

  
MY TEXTBOX   --->  Grand Total amount : - 800


How can I do that if iam counting from a ((Total Column )) DTG
and adding it and showing it in my (( GRAND TOTAL AMOUNT)) TEXTBOX.

Thanks in advance

Naveen.....
Posted
Updated 23-Mar-10 8:37am
v3

1 solution

Your most logical way of doing this is to use SQL on the data source to get a total. However, you can iterate over the rows, then add the values from the column in code if you want, that's an easy enough task.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900