Results 1 to 6 of 6

Thread: [RESOLVED] [2005] Moving ListView items?

  1. #1

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Resolved [RESOLVED] [2005] Moving ListView items?

    Hello everyone,

    I have a ListView control in tile mode with multiple items. All items have an image and multiple subitems, so it's quite 'heavy'.

    The user can use buttons to move items up and down the list. To make this work, I now create an array of the items in the new order, then I empty the ListView and finally put the new array of items in. Sadly, this works very slow. It literally takes seconds for the new list to display.

    So, I wanted to know, is there a faster way to move items in a listview? It would be great if it was possible to just actually move an item to another position, instead of rebuilding the entire list.

    Thanks for any help,
    arsmakman.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Moving ListView items?

    Yes, I will do you an example.

  3. #3

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Re: [2005] Moving ListView items?

    Thank you.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Moving ListView items?

    Here you go.

    It assumes multiselect is set to false. You would have to add additional code to move mutliple items at once... however if that is what you want to do, this code should get you started.
    Attached Files Attached Files

  5. #5

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Re: [2005] Moving ListView items?

    Thank you for the code, it works fine.

    By the way, MultiSelect is indeed disabled, users may only move one item at a time.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [RESOLVED] [2005] Moving ListView items?

    Glad to hear

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