Solved

listview add column

Posted on 2009-06-30
2
344 Views
Last Modified: 2013-11-13
In c#, how to create the column and add the items in listview?

Say one example

0
Comment
Question by:godwindotnet
2 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 24752062
Please specify which kind of GUI library you are using. This will allow us to guide you to the right direction.
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 24760778
Add Data to a ListView
http://www.java2s.com/Code/CSharp/GUI-Windows-Form/AddDatatoaListView.htm

Here is an article on how to use Listviews: http://www.ondotnet.com/pub/a/dotnet/2002/10/28/listview.html

and Here is the msdn documentation on the listview object and the listviewItem object. http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.listviewitem.aspx

I would highly recommend that you at least take the time to skim the documentation on any objects you use from the .net framework. While the documentation can be pretty poor at some times it is still invaluable especially when you run into situations like this.

 it's simply a matter of adding subitems to a listviewitem like so:

ListViewItem i = new ListViewItem("column1");
i.SubItems.Add("column2");
i.SubItems.Add("column3");
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

730 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