T
TG
Hi!
I have a datagridview and I want to sum one of the columns. (column 5)
When I run the following it gives me 0 instead of 10106 which is the
total of those rows.
Any ideas as to what I am doing wrong?
For i As Integer = 5 To 5
' loop through columns which require
calculating sum
Dim myTotalSum As Integer
For row As Integer = 10 To
DataGridView1.Rows.Count - 1
myTotalSum +=
Convert.ToInt16(DataGridView1(i, row).Value)
Next
DataGridView1(i, DataGridView1.Rows.Count -
1).Value = myTotalSum.ToString()
Next
Thank you!
Tammy
I have a datagridview and I want to sum one of the columns. (column 5)
When I run the following it gives me 0 instead of 10106 which is the
total of those rows.
Any ideas as to what I am doing wrong?
For i As Integer = 5 To 5
' loop through columns which require
calculating sum
Dim myTotalSum As Integer
For row As Integer = 10 To
DataGridView1.Rows.Count - 1
myTotalSum +=
Convert.ToInt16(DataGridView1(i, row).Value)
Next
DataGridView1(i, DataGridView1.Rows.Count -
1).Value = myTotalSum.ToString()
Next
Thank you!
Tammy