EDN Admin
Well-known member
Im trying to get a value in a datagrid to highlight based on the value from a textbox, I cant seem to figure out why its not working right.
<pre> Dim xdata As String = TextBox1.Text
Dim cell As DataGridViewCell
Dim cellVar As String[/code]
<pre>
For Each row As DataGridViewRow In Me.Tbl_NameDataGridView.Rows
cell = row.Cells(0)
cellVar = row.Cells(0).Value
If cellVar.Contains(xdata) Then
cell.Style.BackColor = Color.Red
End If
Next[/code]
<br/>
<br/>
<hr class="sig I will be legendary someday, just not today.
View the full article
<pre> Dim xdata As String = TextBox1.Text
Dim cell As DataGridViewCell
Dim cellVar As String[/code]
<pre>
For Each row As DataGridViewRow In Me.Tbl_NameDataGridView.Rows
cell = row.Cells(0)
cellVar = row.Cells(0).Value
If cellVar.Contains(xdata) Then
cell.Style.BackColor = Color.Red
End If
Next[/code]
<br/>
<br/>
<hr class="sig I will be legendary someday, just not today.
View the full article