Solved

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

Posted on 2006-07-13
2
235 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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