title: How to highlight a row in ListView when a data value is low
body: <p>What I want to happen is that when the <code>Quantity</code> on an item in a <code>ListView</code> is less than 10, the row's backcolor will change. My code below only changes the back color of the last row. Please help. </p>
  
  <pre><code>   Dim list1 As New ListViewItem()
     Dim blank As List(Of String) = New List(Of String)
     Dim product As List(Of String) = New List(Of String)
  
     Private Sub LoadDatabase()
        productReport.Items.Clear()
        command.CommandText = "SELECT Product_Code, Product_Name, Quantity, Unit, Category, Location, Description FROM tblProduct"
        command.Connection = connect
        adapter.SelectCommand = command
        reader = command.ExecuteReader()
        While reader.Read
            list1 = productReport.Items.Add(reader.GetString(0))
            list1.SubItems.Add(reader.GetString(1))
            list1.SubItems.Add(reader.GetString(2))
            list1.SubItems.Add(reader.GetString(3))
            list1.SubItems.Add(reader.GetString(4))
            list1.SubItems.Add(reader.GetString(5))
            list1.SubItems.Add(reader.GetString(6))
            quantity.Add(reader.GetValue(2))
            blank.Add(reader.GetString(4))
        End While
     reader.Close()
     End Sub
  
     Public Sub viewCritical()
              Dim a = productReport.Items.Count
              For x As Integer = 0 To productReport.Items.Count - 1
                  a = a - 1
                  If (quantity.Item(a) &lt; 15) Then
                      list1.SubItems(a).BackColor = Color.LightCoral
                      Label1.Show()
                  End If
                  If (blank.Item(a) = "") Then
                      list1.SubItems(a).BackColor = Color.LightGreen
                      Label3.Show()
                  End If
              Next
          End Sub
  </code></pre>