Hello to all,
I need a help with filtering data in RichTextBox by some strings from DataGridView.
I have an report of the all currently used network licenses of an software, so I need to check are the all of the users who used the license my colleagues or not. I have created msaccess database of the machines of my colleagues and now I want to filter report. If the user in the report content is already in the DataGridView column "Machines" then color it as green and all other color as red.
All names of the machines has string "@" in the middle so I would like to use that string to filter value.
For example pasted report is:
https://s26.postimg.org/ilh92zwu1/report_content.png
Here is my form:
https://s26.postimg.org/673nu5k3d/form.png
Here is what I expect:
https://s26.postimg.org/5iutb7ldl/after_filetring.png
Any help is very appreciated.
What I have tried:
Private getnumber As String = "@"
Private Sub RichTextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles RichTextBox1.TextChanged
For Each row As DataGridViewRow In DataGridView1.Rows
Dim filteredText As String = row.Cells(2).Value
For Each m As Match In Regex.Matches(RichTextBox1.Text, getnumber)
'what?
Next
Next
End Sub