Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Text item is adding to the incorrect column on a listview control

Posted on 2006-07-13
2
Medium Priority
?
237 Views
Last Modified: 2010-04-16
I want to add Dexcription to the 2nd column "Description" but instead it's added to the 1st column, "Name".  How do I correct this?  

      private void CreateUnityListView()
        {
            NodeDetail.Columns.Clear();
            NodeDetail.Items.Clear();
            NodeDetail.View = View.Details;
            //Create the columns for the listview for the Unity

            NodeDetail.Columns.Add("Name", "Name", 200, HorizontalAlignment.Left, 0);
            NodeDetail.Columns.Add("Description", "Description", 280, HorizontalAlignment.Left, 0);
            NodeDetail.Items.Add("Description", "Folder for context mappings", 7);
        }
0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17105131
What are you dealing with here?  Not enough information?  What is NodeDetail?  Are you working with a ListView?  If you are then you need to add subitems to the item.

Bob
0
 
LVL 5

Accepted Solution

by:
nickhoggard earned 1000 total points
ID: 17106145
Hi

Try

            NodeDetail.Items.Add(new ListViewItem(new string[] { "Description", "Folder for context mappings" }));

Cheers

Nick
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question