title: How to highlight invalid data on gridview if validation against a DataTable is failed VB.Net?
body: <p>I tried my best to shrink down the program to the following code. In this example, I have UK and USA as valid countries. If someone lives outside those countries, I wanna show an error message and highlight them on the gridview. For example, John and Chris are from China so they should be highlighted on the gridview.  Is it possible to do that ? Please see example picture. Either just Name or the whole row can be highlighted.</p>
  
  <p>Thanks a lot.</p>
  
  <pre><code>    Dim dt As New DataTable
      dt.Columns.Add("ID")
      dt.Columns.Add("Name")
      dt.Columns.Add("Country")
  
      dt.Rows.Add("1", "John", "China")
      dt.Rows.Add("2", "Harry", "USA")
      dt.Rows.Add("3", "Joe", "UK")
      dt.Rows.Add("4", "Emma", "UK")
      dt.Rows.Add("5", "Chris", "China")
      dt.Rows.Add("6", "Jenny", "UK")
  
  
      Dim isValid As Boolean = True
      Dim keywords() As String = {"UK", "USA"}
      Dim str As String = ""
  
      For Each x As DataRow In dt.Rows
          If Not keywords.Contains(x("Country").ToString()) = True Then
              isValid = False
          End If
      Next
  
      If isValid = False Then
          lblmessage.Text = "Some people don't live in valid countries"
      End If
  
      GridView1.DataSource = dt
      GridView1.DataBind()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/5X00P.jpg" alt="enter image description here"></p>