I am trying to keep a running total of the number of checkboxes selected in a datagrid. My problem is not in the coding but how to invoke the code after each selection/deselection?
The default event for the checkbox is
Protected Sub CheckBox_Select_CheckedCha
sender As Object, ByVal e As System.EventArgs)
however this event is not triggered when a checkbox is changed.
any clues to why this would not be trigerred? could it be something to do with masterpages? or being inside an accordion control
' This code works if I request it from a button but the
Protected Sub CheckBox_Select_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim cb As CheckBox
Dim row As GridViewRow
Dim contactCounter As Integer = 0
For Each row In GridView1.Rows
cb = CType(row.FindControl("CheckBox_Select"), CheckBox)
If cb.Checked Then
contactCounter = contactCounter + 1
Label_contactsSelected.Text = contactCounter & " contacts selected"