I would suggest you to build your own dgv which inherits DataGridView and which contains the Methods which are required by you. Here is an Example how it could be realized :
Public Class myDGV
Inherits DataGridView
Sub Init() Handles Me.HandleCreated
Columns.Add("C1", "")
Columns.Add("C2", "")
Columns.Add("C3", "")
Columns.Add("C4", "")
Rows.Add(1.5, 4, 9, 0.25)
Rows.Add(2.5, 2.5, 2.5, 1)
Rows.Add(2.0, 3.5, -2.5, 1.5)
End Sub
ReadOnly Property RowSum As Single()
Get
Dim Sum(Rows.Count - 1) As Single
For i As Integer = 0 To Columns.Count - 1
For j As Integer = 0 To Rows.Count - 1
Sum(j) += CSng(Rows(j).Cells(i).Value)
Next
Next
Return Sum
End Get
End Property
ReadOnly Property ColumnSum As Single()
Get
Dim Sum(Columns.Count - 1) As Single
For i As Integer = 0 To Rows.Count - 1
For j As Integer = 0 To Columns.Count - 1
Sum(j) += CSng(Rows(i).Cells(j).Value)
Next
Next
Return Sum
End Get
End Property
ReadOnly Property GridSum As Single
Get
Dim Sum As Single = 0.0
For i As Integer = 0 To Rows.Count - 1
For j As Integer = 0 To Columns.Count - 1
Sum += CSng(Rows(i).Cells(j).Value)
Next
Next
Return Sum
End Get
End Property
End Class
The Method Init at the beginnig is only for testing and to fill the DGV with some values ...