I'musingvb.net andhave a winform datagridview with a column of checkboxes. I'd like to loop through and count the boxes that are checked and put that value into a variable to be used elsewhere. Seems like this should be pretty straight forward but I can only find examples for ASP and C#.
Below is what I have so far. It stops working if I have more than 1 box checked...meaning, If I have no boxes checked it will return "0". If I have 1 box checked it will return "1". If I have 2 or more boxes checked it returns "1". Thanks in for the help.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim count = 0
Dim row As DataGridViewRow
For Each row In TblOrgPhoneDataGridView.Rows
If row.Cells(3).Value = True Then
count = +1
End If
Next
MessageBox.Show(count)
End Sub