Link to home
Start Free TrialLog in
Avatar of wclairmont
wclairmont

asked on

VB6 Listview Hidden column appears on row select

Can someone help me!

I have  a listview populated by an ADO dataset. In this listview there are 4 columns, and the first column is hidden (width = 0).  When I select any row in the listbox, the first column appears displaying the current value (primary key) of row selected.  Is there a way to turn this off? Or do I have to code for this? if I have to code for this, please lead me in the right direction...

Unfortunately I have tried everything to no avail, so any help would be appreciated!

Thanks a bunch!
ASKER CERTIFIED SOLUTION
Avatar of pjcrooks2000
pjcrooks2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wclairmont
wclairmont

ASKER

I am using the control to build the list view, and setting the column widths and options within the properties wizard.  I have no code for the listview other than that to populate the data, which is working ok.

Its just the listview control... (i wish I could send you a picture of the appearing hidden column)

Why don't you put your data into a combo box


This is how I do it and it works well for me:

Private Sub FillListView()
            Dim strKey As String
            With lsvInvoiceDetails
                LockWindowUpdate Me.hWnd
                .View = lvwReport
                .ListItems.Clear
                .ColumnHeaders.Clear
                               
                .ColumnHeaders.Add 1, "ItemNo", "Item No.", 1500
                .ListItems.Add 1, , "Hidden"
            End With
End Sub
Sorry you will have to replace 1500 with 0
This is how:

Private Sub FillListView()
            Dim strKey As String
            With lsvInvoiceDetails
                LockWindowUpdate Me.hWnd
                .View = lvwReport
                .ListItems.Clear
                .ColumnHeaders.Clear
                               
                .ColumnHeaders.Add 1, "ItemNo", "Item No.", 0
                .ListItems.Add 1, , "Hidden"
            End With
End Sub