Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change column problem
Message
From
19/11/2004 11:51:41
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Change column problem
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
00963003
Message ID:
00963003
Views:
39
I am designing a datagrid for processing order details, i want each time i change price or quantity recalculate item total and order total(quantity*price, sum(quantity*price),in VFOX i do it in the valid event of each textbox in the datagrid i call a method in the form that perform calculation, in Vb.net i trap columnchanging and rowchanged to perform that, but it seems to work only with first row, for the next rows i have to move up or down in the datagrid to reflex changes in item total and order total, here is my code, if any one can help me.

Thank's

'Code to calculate order total
Sub total()
Dim decTotal As Decimal
decTotal = Convert.ToDecimal(ds.Tables("movdet").Compute("sum(Total)", "cantidad<>0"))
Me.TxtTotal.Text = Format(decTotal, "#,###,##0.00")
End Sub

Sub Cambio_columna(ByVal sender As Object, ByVal e As DataColumnChangeEventArgs)
Me.BindingContext(ds, ds.Tables("movdet").TableName).EndCurrentEdit()
End Sub
Sub Cambio_fila(ByVal sender As Object, ByVal e As DataRowChangeEventArgs)
Me.total()
End Sub
Reply
Map
View

Click here to load this message in the networking platform