Listview columns question
Listview columns question
Listview columns question
Listview columns question
Listview columns question
Listview columns question Listview columns question Listview columns question Listview columns question Listview columns question Listview columns question Listview columns question Listview columns question
Listview columns question Listview columns question
Listview columns question
Go Back  Xtreme Visual Basic Talk > > > Listview columns question


Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2004, 12:55 PM
AtmaWeapon's Avatar
AtmaWeaponListview columns question AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default Listview columns question


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.
Reply With Quote
  #2  
Old 08-24-2004, 01:25 PM
liwo's Avatar
liwo liwo is offline
Centurion
 
Join Date: Oct 2003
Location: Germany
Posts: 116
Default

Have you added a subitem that contains the text for the new collum for each item?
__________________
Please use [vb][/vb] Tags instead of [code][/code] Tags when posting VB Code. Thank you.
Reply With Quote
  #3  
Old 08-24-2004, 01:38 PM
AtmaWeapon's Avatar
AtmaWeaponListview columns question AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

At the moment, the ListView has no items.
__________________
.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.
Reply With Quote
  #4  
Old 08-24-2004, 01:50 PM
liwo's Avatar
liwo liwo is offline
Centurion
 
Join Date: Oct 2003
Location: Germany
Posts: 116
Default

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.
Reply With Quote
  #5  
Old 08-24-2004, 02:42 PM
AtmaWeapon's Avatar
AtmaWeaponListview columns question AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
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
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Listview columns question
Listview columns question
Listview columns question Listview columns question
Listview columns question
Listview columns question
Listview columns question Listview columns question Listview columns question Listview columns question Listview columns question Listview columns question Listview columns question
Listview columns question
Listview columns question
 
Listview columns question
Listview columns question
 
-->