Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView

Status
Not open for further replies.

hariram55

Programmer
Jul 28, 2006
10
US
Does anybody can help me with listview. I have 12 column headers and I want to print (display) the result in certain column only of certain row. For eg: for row 1 I want to display result in column 6 and for second row in column 7.

I am using:
Listview1.items(1).subitems.add(“result”).. this will print in first row and first column.. I want to print this out in 6th column..how can I do that?
 
When you create ListViewSubItems for a ListViewItem, that time based on which columns are going to be null, pass empty string ("") for text. Then add those SubItems to Item and add Item to ListView.
Code:
Dim x As New Windows.Forms.ListViewItem("PARENT")
Dim i1 As New Windows.Forms.ListViewItem.ListViewSubItem(x, "SubItem1")
Dim i2 As New Windows.Forms.ListViewItem.ListViewSubItem(x,"")        
Dim i3 As New Windows.Forms.ListViewItem.ListViewSubItem(x, "SubItem3")
x.SubItems.Add(i1)
x.SubItems.Add(i2)
x.SubItems.Add(i3)
ListView1.Items.Add(x)
I think this may give you some idea...

Sharing the best from my side...

--Prashant--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top