For i As Integer = 0 To ListView_tools.Items.Count - 1
If ListView_tools.Items(i).SubItems(5).Text <> 1 Then
ListView_tools.Items(i).SubItems(5).BackColor = Color.Red
End If
Next
For i = 0 To dts.Rows.Count - 1
If dts.Rows(i)(4).ToString = "1" Then
lvwItem = New ListViewItem(dts.Rows(i).Item("ID").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Product1").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Type").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Total").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Num").ToString)
ListView1.Items.Add(lvwItem)
lvwItem.BackColor = Color.Blue
Else
lvwItem = New ListViewItem(dts.Rows(i).Item("ID").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Product1").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Type").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Total").ToString)
lvwItem.SubItems.Add(dts.Rows(i).Item("Num").ToString)
ListView1.Items.Add(lvwItem)
End If
Next