Results 1 to 5 of 5

Thread: [RESOLVED] Child items in a listview

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Resolved [RESOLVED] Child items in a listview

    Hello, I found the project below that is a Listview with child items in the first column (like a treeview).

    When you double-click on an item it expands and adds 10 child items. What I'd like to do is add child items without expanding, so the child items are not visible, but still can be used. After playing around with it for an hour I haven't been able to do it.

    Is there anybody who wants to take a look at the code and tell me if it's possible to add child items in the first column without expanding and making them visible?

    Thank you.

    Last edited by Chris001; Sep 12th, 2010 at 12:42 PM.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Child items in a listview

    If you don't need the treeview type functionality you may assign the "child" value to some array or array of UDT or collection (would probably be easier) where keye = current listitem.text or listitem.key.
    And btw, you may want to use the regular listview.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Child items in a listview

    An array is what I used first, but with 300 items and an average of 175 'child' values for each item it gets a bit difficult to work with. Storing everything in text files and continuously opening/reading the text file(s) to get the required values is something I'm trying to avoid.

    I was hoping I could add invisible 'child' values and loop through them to get the required value. Maybe I can add 175 Listview columns and make them invisible, but so many columns (even if they're hidden) might cause problems, right?

    The project above is using a regular Listview.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Child items in a listview

    That would be too many columns. I really don't see any problems with using array - they are fast in VB.
    You may also try building your own class and for each new item you would create a new instance and add that new instance to collection. But I think I've mentioned collection already in my earlier post.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Child items in a listview

    Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width