Need some help with listView

Ennio

Member
Joined
Mar 5, 2006
Messages
23
Programming Experience
Beginner
I have a listview with this columns

'Create the Columns name
lsvReport.Columns.Add("Project Name", 150, HorizontalAlignment.Center)
lsvReport.Columns.Add(
"Time In", 100, HorizontalAlignment.Left)
lsvReport.Columns.Add(
"Time Out", 100, HorizontalAlignment.Left)
lsvReport.Columns.Add(
"Total hours worked", 120, HorizontalAlignment.Left)

Now on the listview I can see the columns name OK, but when I do this

lsvReport.Items.Add("Test")
lsvReport.Items.Add("Test2")
lsvReport.Items.Add("Test3")

It doesn't put next to each other it add on to each line, how can I add the text to the columns that I want?

Thank You
 
Hello Ennio, please post in appropriate forum, I moved thread to Listviews/Treeviews.

In detail view of Listview the first column is main item, other columns are subitems of the main item, see example:
VB.NET:
dim lvi as ListViewItem = lsvReport.Items.Add("Test")
[SIZE=2]lvi.SubItems.Add("Test2")
lvi.SubItems.Add("Test3")
[/SIZE]
 
Back
Top