ListView not showing Header or data

I am using VB.Net in VS 2008 . I have never used a ListView control before. I am trying to create a List view with 4 columns and one tag attached to the first column.
When I execute the attached code, I do not receive any errors. However, the ListView control does not display any Headers. The only data displayed is the Employee ID. There are no subitems.
Is my code incorrect? Is there a property of the ListView that I have set incorrectly (the only property I changed was MultiSelect. I changed it to False). Or something else?
Thanks,
pat
Private Sub LoadListView()
        Dim GMFConn As New System.Data.SqlClient.SqlConnection
        Dim GMFCmd As New System.Data.SqlClient.SqlCommand
        Dim GMFReader As System.Data.SqlClient.SqlDataReader
        Dim ParmString As String = ""
        Dim FirstString As String = ""
        Dim LastString As String = ""
        Dim EmpIDNoString As String = ""
        Dim IDNoLong As Long = 0
        Dim CrewString As String = ""
        Dim LineString As String = ""
        Dim ColumnHeaderListView As ColumnHeader
        Dim ListItem As ListViewItem
        '
        Me.lvwEmployee.Clear()
        '
        'Add Header columns
        ColumnHeaderListView = New ColumnHeader
        ColumnHeaderListView.Text = "Employee ID"
        Me.lvwEmployee.Columns.Add(ColumnHeaderListView)
        '
        ColumnHeaderListView = New ColumnHeader
        ColumnHeaderListView.Text = "First Name"
        Me.lvwEmployee.Columns.Add(ColumnHeaderListView)
        '
        ColumnHeaderListView = New ColumnHeader
        ColumnHeaderListView.Text = "Last Name"
        Me.lvwEmployee.Columns.Add(ColumnHeaderListView)
        '
        ColumnHeaderListView = New ColumnHeader
        ColumnHeaderListView.Text = "Crew"
        Me.lvwEmployee.Columns.Add(ColumnHeaderListView)
        '
        ColumnHeaderListView = Nothing
        '
        GMFConn.ConnectionString = GMFConnStringPublic
        GMFConn.Open()
        GMFCmd.Connection = GMFConn
        '
        ParmString = "Select IDNo, EmpIdNo,FirstName, LastName,Crew From GMFEmployee Order by FirstName"
        GMFCmd.CommandText = ParmString
        GMFReader = GMFCmd.ExecuteReader
        Do While GMFReader.Read
            If GMFReader.IsDBNull(0) Then IDNoLong = 0 Else IDNoLong = GMFReader.Item("IDNo")
            If GMFReader.IsDBNull(1) Then EmpIDNoString = "" Else EmpIDNoString = GMFReader.Item("EmpIDNo").ToString.Trim
            If GMFReader.IsDBNull(2) Then FirstString = "" Else FirstString = GMFReader.Item("FirstName").ToString.Trim
            If GMFReader.IsDBNull(3) Then LastString = "" Else LastString = GMFReader.Item("LastName").ToString.Trim
            If GMFReader.IsDBNull(4) Then CrewString = "" Else CrewString = GMFReader.Item("Crew").ToString.Trim
            If Val(EmpIDNoString) > 0 Then
                ListItem = New ListViewItem
                ListItem.Tag = IDNoLong
                ListItem.Text = EmpIDNoString
                ListItem.SubItems.Add(FirstString)
                ListItem.SubItems.Add(LastString)
                ListItem.SubItems.Add(CrewString)
                Me.lvwEmployee.Items.Add(ListItem)
            End If
        Loop
        GMFReader.Close()
        '
        GMFCmd.Dispose()
        GMFConn.Close()
        GMFConn.Dispose()
        ListItem = Nothing
    End Sub

Open in new window

mpdillonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
In order to see the columns for a Windows Forms ListView, you need to set the View property to Details.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lazyberezovskyCommented:
I think ListView.View property of lvwEmployee is Title and you need Details.
0
mpdillonAuthor Commented:
The view Property was set to Large Icon. Setting it to Details worked great. Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.