'Please note Col_3 = Quantity, Col_4 = Price and Col_5 = Total
'When Col_5 is set to Editable = False "Disabled" Lostfocus on either Quantity or Price will not change the value in Col_5 which is Total BUT
'When Col_5 is set to Editable = True "Enabled" Lostfocus on either Quantity or Price will change the value in Col_5 which is Total
'My coding environment is Visual Studio .Net
Private Sub eMatrixO_LostFocusAfter(ByVal sboObject As Object, ByVal pVal As SAPbouiCOM.SBOItemEventArg) Handles eMatrixO.LostFocusAfter
If pVal.ItemUID = "MatrixO" And pVal.ColUID = "Col_3" Or pVal.ColUID = "Col_4" Then
Dim C3 As Double = 0
Dim C4 As Double = 0
Dim T As Double = 0
Dim sum As Double = 0
C3 = CDbl(eMatrixO.GetCellSpecific("Col_3", pVal.Row).value)
C4 = CDbl(eMatrixO.GetCellSpecific("Col_4", pVal.Row).value)
T = CDbl(C3) * CDbl(C4)
Me.eCol_3 = CType(Me.eMatrixO.Columns.Item(6).Cells.Item(pVal.Row).Specific, SAPbouiCOM.EditText)
Me.eCol_3.Value = CDbl(T)
For i As Integer = 1 To eMatrixO.RowCount
sum = sum + CDbl(eMatrixO.GetCellSpecific("Col_5", i).value)
Next
etxtTotal.Value = sum
End If
End Sub