From your question I assume two possibilities:
1) When DataGridView is NOT databound:
AFAIK, we can not get the values of a row cell(s) without looping through DataGridViewRowCollection.
One way to do so is using loop:
Dim cnt As Integer = 0
For i As Integer = 0 To DataGridView1.Rows.Count - 1
With DataGridView1.Rows(i).Cells("NameOfYourColumn")
If (.Value = True) Then
cnt += 1
Exit For
End If
End With
Next
Debug.Print(cnt)
using LINQ: (
one line approach)
DataGridView1.Rows.Cast(Of DataGridViewRow).Where(Function(c) c.Cells("NameOfYourColumn").Value = True).Count()
' If count > 0 then some row is checked
2. If DataGridView is databound:
We can make use of
DataView[
^] class or
DataTable.Select[
^] method. See the examples in the attached link.