Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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/
 
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/




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.