Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Object Oriented Best Practice 5 34
Exception in Log4Net 1 19
Data Saving 5 30
VB.NET HttpWebRequest 12 32
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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.
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now