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.
__________________ .NET Resources My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
__________________ .NET Resources My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
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.
__________________
Please use [vb][/vb] Tags instead of [code][/code] Tags when posting VB Code. Thank you.
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.
__________________ .NET Resources My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe