General information
Title:
Change column problem
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only