Click to See Complete Forum and Search --> : formatting Listview


sriky
September 28th, 1999, 09:04 AM
I am using Listview control to display the data from my database. I am using columnheaders property to display column headers:

ListView1.ColumnHeaders.Add , , "Count", ListView1.Width / 4

But I am not seing the colmn headers when i RUN the program. Also the data is displayed in an irregular fashion.

Can someone let me know why?

Please

September 28th, 1999, 01:50 PM
Try this code for the column Header
You also need to make sure that the hideColumnHeaders Property is = False,
You can do this either at runtime or design time


Dim colhead as ColumnHeader


set colhead = ListView1.ColumnHeaders.Add()
colhead.Text = "Count"
colhead.Width = ListView1.Width / 4





for the irregular data, what is specifically happening?

Chris Eastwood
September 28th, 1999, 03:27 PM
It sounds like you haven't got the ListView 'view' property set to lvwReport - try this code where you add the column headers :


With ListView1
.View = lvwReport
.ColumnHeaders.Add , , "Column 1"
.ColumnHeaders.Add , , "Column 2"
.ColumnHeaders.Add , , "Column 3"
'
' etc
'
End With







Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb