Hi,
I have a list view which is populated using thefunctions below. Now, I want to to alternate the rows so that one is white and the other is grey.. How can I achieve that if am working with Visual Studio 2012 and Vb.Net.
Thank you
I have a list view which is populated using thefunctions below. Now, I want to to alternate the rows so that one is white and the other is grey.. How can I achieve that if am working with Visual Studio 2012 and Vb.Net.
Code:
Private Sub PLVUserInfo()
lvwuserinfo.Items.Clear()
For Each com As clsuserdetails In mclsuserdetails
Dim item As New ListViewItem()
PopulateListViewItemUserDetails(item, com)
Me.lvwuserinfo.Items.Add(item)
Next
End Sub
Code:
Private Sub PopulateListViewItemUserDetails(ByVal listViewItem As ListViewItem, ByVal clsuserdetails As clsuserdetails)
listViewItem.Text = clsuserdetails.Username
listViewItem.Tag = clsuserdetails
listViewItem.SubItems.Add(clsuserdetails.Firstname)
listViewItem.SubItems.Add(clsuserdetails.Lastname)
listViewItem.SubItems.Add(clsuserdetails.Keyfobno)
listViewItem.SubItems.Add(clsuserdetails.Userstatus)
listViewItem.SubItems.Add(clsuserdetails.Userid)
End Sub