Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listview does not show any items

Status
Not open for further replies.

dudleys

Technical User
Apr 28, 2005
31
AU
I have a listview and it is not showing any items after I populate it. I set the View prop to Details.
I set the 2 columns in design time columns property.

This the code


Code:
        If objRdr.HasRows Then

            Do While objRdr.Read

                lvItem = New ListViewItem(objRdr("RoundDate").ToString)

                If objRdr.IsDBNull(1) Then
                    lvItem.SubItems.Add("")
                Else
                    lvItem.SubItems.Add(objRdr("Competition"))
                End If
                lstEvents.Items.Add(lvItem)
                
            Loop
        End If


Can't figure this out. Any ideas?
 
What is objRdr ?

If it's a StreamReader, is it pulling in the data correctly?
If objRdr("RoundDate").ToString is an empty string or Nothing then that will give the impression that the listview is not being populated.
When you step through the code does it actually hit the line
lstEvents.Items.Add(lvItem)
or is it jumping the do loop?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top