|
-
Sep 21st, 2005, 09:51 AM
#1
Thread Starter
Junior Member
add subitems to listview
I have a listview with 4 columns.
i added a value in the 1st column like this:
listview1.Items.add("somevalue");
how can i add subitems to this:
I know it's possible in VB.NET to do this with
listview1.item(0).subitems(1).add("blabla")
but this doesn't seem to be possible in C#
anyone knows about this?
-
Sep 21st, 2005, 09:56 AM
#2
Re: add subitems to listview
-
Sep 21st, 2005, 09:18 PM
#3
Hyperactive Member
Re: add subitems to listview
you can also do in this way:
VB Code:
ListViewItem li = listView1.Items.Add("item1");
li.SubItems.Add("sub-item1");
li.SubItems.Add("sub-item2");
-
Sep 21st, 2005, 09:28 PM
#4
Re: add subitems to listview
The code you have posted is trying to call the Add method of a ListViewSubItem object, which does not exist. That code would not work in VB.NET either. You need to remove the index to the Subitems property:
Code:
listview1.item(0).subitems(1).add("blabla")
-
Sep 22nd, 2005, 12:42 AM
#5
Re: add subitems to listview
yeah use brackets if you're accessing array elements
listview1.item[0]....
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 22nd, 2005, 02:43 AM
#6
Thread Starter
Junior Member
Re: add subitems to listview
ok thanks , that really helped me out
-
Sep 22nd, 2005, 02:57 AM
#7
Re: add subitems to listview
Don't forget to resolve your thread from the Thread Tools menu.
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
|