Solved

listview add column

Posted on 2009-06-30
2
324 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 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

17 Experts available now in Live!

Get 1:1 Help Now