Well, you seem to know how to get the cell from a
... The problem is that a cell holds an
. And you can't add
If you're sure cells (2, 3) and (3, 5) always exist and are always filled with a numeric type you could simply do the following:
Dim var As Decimal = CDec(dgvMyGrid.Item(2, 3).Value) + CDec(dgvMyGrid.Item(3, 5).Value)
txtMyTextBox.Text = var.ToString
If the values are
s you could use
. It would be safe to check if the cell exist though...
If dgvMyGrid.Item(2, 3) IsNot Nothing AndAlso dgvMyGrid.Item(3, 5) IsNot Nothing Then
Hope that helps.