Hi,
I want to sum two values being inserted in two cells in a DataGridView.
And the result should be output in a specified cell.
I already wrote a code but my code doesn't work like it supposed to work.
What is wrong with the code?
I want to sum two values being inserted in two cells in a DataGridView.
And the result should be output in a specified cell.
I already wrote a code but my code doesn't work like it supposed to work.
What is wrong with the code?
Code:
Private Sub dgdTax_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgdTax.CellContentClick
'======================================== CALCULATION ==============================================='
'to calculate r4rm1
Dim r2rm1 As Integer
Dim r3rm1 As Integer
Dim r4rm1 As Integer
r2rm1 = Convert.ToInt32(dgdTax(1, 2).Value.ToString())
r3rm1 = Convert.ToInt32(dgdTax(1, 3).Value.ToString())
r4rm1 = r2rm1 + r3rm1
dgdTax(1, 4).Value = r4rm1
End Sub