Solved

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

Posted on 2006-07-13
2
234 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 250 total points
ID: 17106145
Hi

Try

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

Cheers

Nick
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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