Listview columns question

AtmaWeapon
08-24-2004, 12:55 PM
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.

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

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

liwo
08-24-2004, 01: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.

AtmaWeapon
08-24-2004, 02: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