Hi,
I need help with the Listview or Listbox controls in .Net.
I want it to have multiple columns, and I also want the column headers to display.
Please, any suggestions welcome!!!
Printable View
Hi,
I need help with the Listview or Listbox controls in .Net.
I want it to have multiple columns, and I also want the column headers to display.
Please, any suggestions welcome!!!
Thanks, I solved the problem.
Hi, can you describe how to do it? Because I have the same problem... Thx
Add a listview control to your form.
Set the following properties:
Columns - add all your column headers to the collection
View - set to Details
Good Luck!
Linda
:)
I know it :-)
but how to insert text in the columns?
e.g. I have 3 columns in list view, to insert text and picture to first column I used following code:
but how to add text to second column of this row?Code:Dim lvi As New ListViewItem()
With lvi
.ImageIndex = 0
.SubItems(0).Text = "first column"
End With
ListView1.Items.Add(lvi)
Try This:
Dim objListItem As ListViewItem
Dim objListSubItem As ListViewItem.ListViewSubItem
objListItem = New ListViewItem()
objListSubItem = New ListViewItem.ListViewSubItem()
objListItem.Text = "A"
objListSubItem.Text = "B"
objListItem.SubItems.Add(objListSubItem)
objListSubItem = New ListViewItem.ListViewSubItem()
objListSubItem.Text = "C"
objListItem.SubItems.Add(objListSubItem)
lstTest.Items.Add(objListItem)
Good Luck!
Linda
yeeeee, very sophisticated (but works :-)
do you know also how to get itemid when user clicks to listview (e.g. listview1_doubleclick event) and how to order columns (sorting property) when user clicks to column header? Thanks again.
no, unfortunately not. But, please let me know once you've figured it out (if you don't mind!)
OK,
currently I have found how to sort first column only, but this statement doesn't work for all other columns...
this board is for .NET onlyQuote:
Are you talking about the VB6...