Declare some integers for holding the valuesPrivate MonthlyGoal As Integer = 0Private FiscalYrYTD As Integer = 0In your Databound event add up the values:Public Sub dgAttainment_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) If e.Item.ItemType = ListItemType.Item Or _ e.Item.ItemType = ListItemType.AlternatingItem Then‘add the items as you bind each row‘Intellisense will not have the datafield name when you choose ‘e.item.dataitem but just add it anyways – it is the datafield‘that you have used in your datagrid column MonthlyGoal += e.Item.DataItem.MonthlyGoalFiscalYrYTD += e.Item.DataItem.FiscalYrYTDElseIf (e.Item.ItemType = ListItemType.Footer) Then‘put the added values into the appropriate column in the footer e.Item.Cells(6).Text = FormatCurrency(MonthlyGoal, 2) e.Item.Cells(9).Text = FormatCurrency(FiscalYrYTD, 2)end ifEnd Sub
(To send a private comment, use the email page.)
Count: of 1800
Copyright © 2003 Ronda Pederson | about this blog | disclaimer | views to date: 315723 |