Listview columns question

08-24-2004, 11:55 AM
While working with the ListView, I've noticed something that I'd like for someone to confirm/deny.

It would seem that if you add any listview columns after the initialization of the control, they don't appear. The column header appears, but there are no columns and no text.

Surely there is some way to modify the columns outside of the initialization? I haven't played with it much, but so far I've tried adding the columns then calling Refresh(), which didn't work.

Someone point out what I missed.

08-24-2004, 12:25 PM
Have you added a subitem that contains the text for the new collum for each item?

08-24-2004, 12:38 PM
At the moment, the ListView has no items.

08-24-2004, 12:50 PM
So what text do you want to see if there are no items?
When I use Listview1.Columns.Add("NewColHeader", 100, HorizontalAlignment.Left) I get a new column, if I show the gridlines they are displayed correctly and if I add a subitem to each item the text in the new column is also displayed.
I don't really see your problem.

08-24-2004, 01:42 PM
Hmm... It seems like it's only a problem when you specify a width of -2 to autosize the column width. Oh well, that's what Graphics.MeasureString() is for.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum