[RESOLVED] [02/03] listview colour row problem
Hi guys.
i am calling the below procedure each time i add a row to the listview.
the way i see it working as that each time something is added then the rows are coloured dependant on the value of a particualr sub item
the code:
Code:
Private Sub SetRowItemColours()
Dim lvi As ListViewItem = lstJobs.Items(0)
For i As Integer = 0 To lstJobs.Items.Count - 1 Step 1
If lvi.SubItems(1).Text = "NA" Then
lstJobs.Items(i).ForeColor = Color.Red
Else : lstJobs.Items(i).ForeColor = Color.Blue
End If
Next i
End Sub
the problem
when i add the first row the colour woks fine
BUT
all the other rows shall remain this forecolor
what am i doing wrong. i believe that i am not looping properly
thanks for any help in advance:thumb:
Re: [02/03] listview colour row problem
GOT IT
Dim lvi As ListViewItem = lstJobs.Items(0)
Dim i As Integer = 0
For Each lvi In lstJobs.Items
If lvi.SubItems(1).Text = "NA" Then
lstJobs.Items(i).ForeColor = Color.Red
Else : lstJobs.Items(i).ForeColor = Color.Blue
End If
i = i + 1
Next