I didn't look to had a the link, it is a good starting place.
I do my totaling in ItemDataBound event of datagrid:
Private Sub grid_ItemDataBound(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles grid.ItemDataBound
If e.Item.ItemType = ListItemType.Footer Then
Dim dt As DataTable = CType(ViewState("MyData"), DataTable)
Dim dv As New DataView(dt)
dv.RowFilter = "Type <> 5" ' don't include LOW entries!!!
Dim ColTotal(7) As HourX10
Dim drv As DataRowView
For Each drv In dv
For j As Integer = 0 To 7
ColTotal(j) += CType(drv("Day" & (j + 1).ToString),
HourX10)
Next
Next
For j As Integer = 0 To MyTSDetails.WorkDays - 1
With CType(e.Item.Cells(Columns.Day1 + j).FindControl("Day"
& j + 1 & "Total"), Label)
.Text = FooterDate(MyTSDetails.WorkDays - j - 1,
ColTotal(j))
End With
Next
Dim GrandTotal As HourX10
For j As Integer = 0 To 7
GrandTotal += ColTotal(j)
Next
Dim c As TableCell = e.Item.Cells(Columns.Total)
CType(c.FindControl("lblGrandTotal"), Label).Text =
FooterGrandTotal(GrandTotal)
End If
End Sub
(Sorry I didn't generalize it more before posting)
Greg
"mark" <ma**@remove.com> wrote in message
news:4K***************@newsfe4-gui.ntli.net...
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...
http://www.dotnetjunkies.com/Tutoria...0BDAF711D.dcik
Greg
thanks for the link but ive looked there before - it doesnt appear
relevant,
im totalling on runtime using code behind like this :-
If Me.Datagrid1.Items(counter).Cells(8).Text.ToString = "" Or
Me.Datagrid1.Items(counter).Cells(8).Text.ToString = " " Then
Me.Datagrid1.Items(counter).Cells(8).Text = ""
Else : dsoi = dsoi + 1
dsoiavg = dsoiavg + Me.Datagrid1.Items(counter).Cells(8).Text.ToString
End If
be nice if i could put these totals into the footer - atm im using labels
outside the datagrid