Here is a code snippet that I found online a while ago that helps: Try this code in DataGrid CellEndEdit Events (note: this will sum the items not multiply. So you will just modify it to check whether the cells have values and then multiply the values. i am to lazy to retype it)
Dim iTotal As Integer = 0
With DataGrid1
For i As Integer = 0 To .ColumnCount - 2
If Not IsDBNull(.Rows(e.RowIndex).Cells(i).Value) Then
iTotal += .Rows(e.RowIndex).Cells(i).Value
End If
Next
.Rows(e.RowIndex).Cells(.ColumnCount - 1).Value = iTotal
End With
modified on Wednesday, January 27, 2010 2:59 AM