PC Review


Reply
Thread Tools Rate Thread

Datagrid (InvoiceDetail) - How to cal the totalamt

 
 
Agnes
Guest
Posts: n/a
 
      3rd Aug 2004
I got master-detail datatable
in my datagrid (invoicedetail) , I want to (as the user type the unit price
or no of unit), the amount will be caculated and the TOTAL amount can be
update too.

In my columnchanged event
e.Row("invamt") = e.Row("unitprice") * e.Row("noofunit") *
e.Row("exrate")

drInvInfo =
Me.dsSeaInvInfo.Tables("invoiceHeader").Rows(bmSeaInvInfo.Position)
For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
seems fail
Next
Me.txtTotalAmt.Text = decTtlAmt
Please help~~


 
Reply With Quote
 
 
 
 
Agnes
Guest
Posts: n/a
 
      3rd Aug 2004
I find my problem [It seems I need to update the mastertable "InvoiceTable"
first ]
otherwise , I can't sum up the detail tables , Really ??

"Agnes" <(E-Mail Removed)> 在郵件
news:%(E-Mail Removed) 中撰寫...
> I got master-detail datatable
> in my datagrid (invoicedetail) , I want to (as the user type the unit

price
> or no of unit), the amount will be caculated and the TOTAL amount can be
> update too.
>
> In my columnchanged event
> e.Row("invamt") = e.Row("unitprice") * e.Row("noofunit") *
> e.Row("exrate")
>
> drInvInfo =
> Me.dsSeaInvInfo.Tables("invoiceHeader").Rows(bmSeaInvInfo.Position)
> For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
> decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
> seems fail
> Next
> Me.txtTotalAmt.Text = decTtlAmt
> Please help~~
>
>



 
Reply With Quote
 
Agnes
Guest
Posts: n/a
 
      3rd Aug 2004
PArt II [I found that I need to update both Tables, so I can sum up the
column]
But it seems not fansy, the user should be input all the information and
check the totalamount
then press "SAVE" and then get the invoice no. How can I do that ??
thanks
"Agnes" <(E-Mail Removed)> 在郵件
news:%(E-Mail Removed) 中撰寫...
> I got master-detail datatable
> in my datagrid (invoicedetail) , I want to (as the user type the unit

price
> or no of unit), the amount will be caculated and the TOTAL amount can be
> update too.
>
> In my columnchanged event
> e.Row("invamt") = e.Row("unitprice") * e.Row("noofunit") *
> e.Row("exrate")
>
> drInvInfo =
> Me.dsSeaInvInfo.Tables("invoiceHeader").Rows(bmSeaInvInfo.Position)
> For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
> decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
> seems fail
> Next
> Me.txtTotalAmt.Text = decTtlAmt
> Please help~~
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MVVM: Single datagrid row selection when a datagrid contains anotherdatagrid in side RowDetailsTemplate Sunita@.NET Microsoft C# .NET 0 12th Nov 2010 09:03 AM
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event. Daniel Roth Microsoft Dot NET Framework 0 5th Apr 2005 04:54 AM
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls thegame Microsoft ASP .NET 1 28th Feb 2005 04:23 PM
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False Amar Microsoft ASP .NET 0 6th Apr 2004 11:14 AM
Need Help Determining DataGrid Column Selected for Sort using IBindingList - Datagrid.zip (0/1) David Elliott Microsoft Dot NET Framework Forms 1 18th Jul 2003 02:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:03 AM.