I'm trying to loop certain columns and rows from a datagrid, sum those rows and show them on a chart.
I am able to do the row sums one by one with this code:
Dim sum = (From row As DataGridViewRow In dgvData.Rows.Cast(Of DataGridViewRow)()
Select CDec(row.Cells(5).Value)).Sum
X = sum.Tostring
then I write the column name manually in the chart
Me.Chart1.Series("Repairs").Points.AddXY("Unit Count", x)
and im able to do the row sums loop
For i As Integer = 5 To 15
Dim sum = (From row As DataGridViewRow In dgvData.Rows.Cast(Of DataGridViewRow)()
Select CDec(row.Cells(i).Value)).Sum
Me.Chart1.Series("Repairs").Points.AddXY("Unit Count", (sum.ToString))
Next
but i dont know how to read the column headers
I don't know how to write a loop that would
look at columns headers 5-15 save their names (col)
loop those values into
Me.Chart1.Series("Repairs").Points.AddXY("col", sumOFrows)
any help would be much appreciative