Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 5th, 2005, 08:01 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default Disappearing ListView Columns

Hi all,

I'm a bit stumped with this, wondering if anyone can shed some light.

I'm using C# (2003), created a Form with a TabControl on it. The first tab contains text entry fields, the second contains a ListView control with View set to Details. I've added two column headers in design mode (which show up beautifully in design mode).

The TabControl starts out disabled and then becomes enabled. At that point, when I change to the second tab page, the ListView control has a flat, gray bar at the top (as if no columns were added). Further, if I try to add items to the ListView, they don't show up. If I change the View of the ListView to anything other than Details, adding items works as you'd expect.

I'm not using any imagelists with the ListView control, and I'm not sure if that has anything to do with it. Any ideas?

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
__________________
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
Reply With Quote
  #2 (permalink)  
Old June 1st, 2006, 04:43 PM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure if you ever solved your problem. However, I had the same problem and I thought I would just post the solution I found in case others have the same problem.

The problem I had that was showing the same behavior was that when I was clearing the data I mistakenly was clearing the listview object instead of the items from the listview object. So, this is why you could posibly see the columns in the designer, but not at runntime. So, change the following:

listview1.Clear();

to

listview1.Items.Clear();

Gook Luck!

Ian

http://www.natzmer.com/ian/
http://www.hiddendragonimports.com/
Quote:
quote:Originally posted by nzakas
 Hi all,

I'm a bit stumped with this, wondering if anyone can shed some light.

I'm using C# (2003), created a Form with a TabControl on it. The first tab contains text entry fields, the second contains a ListView control with View set to Details. I've added two column headers in design mode (which show up beautifully in design mode).

The TabControl starts out disabled and then becomes enabled. At that point, when I change to the second tab page, the ListView control has a flat, gray bar at the top (as if no columns were added). Further, if I try to add items to the ListView, they don't show up. If I change the View of the ListView to anything other than Details, adding items works as you'd expect.

I'm not using any imagelists with the ListView control, and I'm not sure if that has anything to do with it. Any ideas?

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Listview Columns? jakeone Beginning VB 6 12 October 2nd, 2008 03:52 PM
disappearing spaces gezi XSLT 0 March 26th, 2006 02:23 AM
Can we reposition the columns o listview-VB.NET pauljoy Pro VB 6 0 January 10th, 2006 01:43 AM
Moving columns i ListView problems Skorpa C# 3 May 18th, 2004 01:43 AM
Listview columns Duncan VS.NET 2002/2003 0 April 16th, 2004 03:00 AM



All times are GMT -4. The time now is 08:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.