I am trying to get a count of all instances of "IN" from a populated datagrid using:
Private Sub Counts()
Dim INCount As Integer = 0
Dim INFinder As Regex = New Regex("IN")
For Each row As DataGridViewRow In Me.dgResults.Rows
For Each cell As DataGridViewCell In row.Cells
INCount += INFinder.Matches(cell.ToString).Count
Next
Next
tslIN.Text = INCount
tslOUT.Text = Math.Abs(INCount - dgResults.RowCount)
End Sub
But instead "cell.ToString" is yielding "DataGridViewTextBoxCell { ColumnIndex=0, RowIndex=0 }" ????
Any ideas?
Also what would be the best way to search on a specific column?
TIA,
Stue