Member Avatar for DyO1

I added a ListView object, added few Columns, but the problem is there that I can't add no text to the other columns by making new Items

Any help?

Recommended Answers

All 2 Replies

Are you trying to add multiple cells in a single row?

Dim lvi As New ListViewItem

With lvi
    .Text = "Column1"
    .SubItems.Add("Column2")
    .SubItems.Add("Column3")
    .SubItems.Add("Column4")
End With

ListView1.Items.Add(lvi)

If you are wanting to add a column to the listview try:

ListView1.Columns.Add("ColumnName")

You can add items more concisely by

ListView1.Items.Add(New ListViewItem({"Column1","Column2","Column3",Column4"}))
commented: Clear n' Concise! +9
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.