|
-
Nov 19th, 2001, 01:40 AM
#1
Thread Starter
Member
Listbox / Listview columns
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!!!
-
Nov 19th, 2001, 02:37 AM
#2
Thread Starter
Member
SOLVED
Thanks, I solved the problem.
-
Jan 4th, 2002, 06:01 AM
#3
Addicted Member
Hi, can you describe how to do it? Because I have the same problem... Thx
-
Jan 4th, 2002, 06:12 AM
#4
Thread Starter
Member
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
-
Jan 4th, 2002, 06:16 AM
#5
Addicted Member
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:
Code:
Dim lvi As New ListViewItem()
With lvi
.ImageIndex = 0
.SubItems(0).Text = "first column"
End With
ListView1.Items.Add(lvi)
but how to add text to second column of this row?
-
Jan 7th, 2002, 06:06 AM
#6
Thread Starter
Member
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
-
Jan 8th, 2002, 03:22 AM
#7
Addicted Member
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.
-
Jan 8th, 2002, 03:36 AM
#8
Thread Starter
Member
no, unfortunately not. But, please let me know once you've figured it out (if you don't mind!)
-
Jan 8th, 2002, 03:49 AM
#9
Addicted Member
OK,
currently I have found how to sort first column only, but this statement doesn't work for all other columns...
-
Feb 1st, 2002, 03:14 AM
#10
Addicted Member
Are you talking about the VB6...
this board is for .NET only
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|