ASP.Net - Component One - GridView controls

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Partial Class x...

'
' declare footer variables
'
Dim _numPeople As Integer = 0
Dim _LessBase80 As Integer = 0
Dim _NotApproved As Integer = 0
Dim _Approved As Integer = 0

Protected Sub gvPostingStatus_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvPostingStatus.DataBinding
'
' This is called when the
' grid starts to be displayed
'
_numPeople = 0
_LessBase80 = 0
_NotApproved = 0
_Approved = 0
End Sub


Protected Sub gvPostingStatus_RowDataBound(ByVal sender As Object, ByVal e As C1.Web.Wijmo.Controls.C1GridView.C1GridViewRowEventArgs) Handles gvPostingStatus.RowDataBound
'
' this is executed once each time a
' row on the grid is being rendered
'

If (e.Row.RowType = C1.Web.Wijmo.Controls.C1GridView.C1GridViewRowType.DataRow) Then
_numPeople += e.Row.Cells(3).Text
_LessBase80 += e.Row.Cells(4).Text
_NotApproved = e.Row.Cells(5).Text
_Approved = e.Row.Cells(6).Text

' here is an alternate method using the business boject bound to the gridview

Dim status As SASD_Employee.boPostingStatus _
= CType(e.Row.DataItem, SASD_Employee.boPostingStatus)


_numPeople += status.NumPeople ' e.Row.Cells(3).Text
_LessBase80 += status.LessThanBase80 ' e.Row.Cells(5).Text
_NotApproved += status.NotApproved ' e.Row.Cells(6).Text
_Approved += status.SupApproved ' e.Row.Cells(7).Text
End If
End Sub


Protected Sub gvPostingStatus_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvPostingStatus.DataBound
'
' This is called at the end all the data
' has retreived from teh grid
'
gvPostingStatus.Columns(3).FooterText = _numPeople
gvPostingStatus.Columns(4).FooterText = _LessBase80
gvPostingStatus.Columns(5).FooterText = _NotApproved
gvPostingStatus.Columns(6).FooterText = _Approved
End Sub