help adding and removing items from a listview 
Author Message
 help adding and removing items from a listview

Hello,
I was wondering if anyone can help me with this.
I'd like to give an option to my users in which they can prioritize the
items in a listview by clicking on an 'up' or 'down' button.
The only way I was able to do this, was by removing the item selected
and the previous item, and adding them in reverse order (selected was
added first, and previous was added second). For some reason, although
I'm doing the above, the items are added in the exact order they were
before. To make things more simple, take this example: I have items 1
and 2. I want 2 to come before 1. I add 2 and then I add 1 which should
put it in the right order, but whatever I seem to do it adds the 1
before the 2 like before

Thanks In Advance,
Leah Gerstenblit



Fri, 12 Jul 2002 03:00:00 GMT  
 help adding and removing items from a listview

Quote:

>Hello,
>I was wondering if anyone can help me with this.
>I'd like to give an option to my users in which they can prioritize the
>items in a listview by clicking on an 'up' or 'down' button.
>The only way I was able to do this, was by removing the item selected
>and the previous item, and adding them in reverse order (selected was
>added first, and previous was added second). For some reason, although
>I'm doing the above, the items are added in the exact order they were
>before. To make things more simple, take this example: I have items 1
>and 2. I want 2 to come before 1. I add 2 and then I add 1 which should
>put it in the right order, but whatever I seem to do it adds the 1
>before the 2 like before

>Thanks In Advance,
>Leah Gerstenblit

It is hard to tell what your data type is from your posting, BUT the general
way to do this (without moving the data) is to use an array of indexes.
When you "sort" just put the indexes in the sequence desired and call the
items indirectly by using the index array.


Fri, 12 Jul 2002 03:00:00 GMT  
 help adding and removing items from a listview
thanks!
Quote:


> >Hello,
> >I was wondering if anyone can help me with this.
> >I'd like to give an option to my users in which they can prioritize the
> >items in a listview by clicking on an 'up' or 'down' button.
> >The only way I was able to do this, was by removing the item selected
> >and the previous item, and adding them in reverse order (selected was
> >added first, and previous was added second). For some reason, although
> >I'm doing the above, the items are added in the exact order they were
> >before. To make things more simple, take this example: I have items 1
> >and 2. I want 2 to come before 1. I add 2 and then I add 1 which should
> >put it in the right order, but whatever I seem to do it adds the 1
> >before the 2 like before

> >Thanks In Advance,
> >Leah Gerstenblit

> It is hard to tell what your data type is from your posting, BUT the general
> way to do this (without moving the data) is to use an array of indexes.
> When you "sort" just put the indexes in the sequence desired and call the
> items indirectly by using the index array.



Fri, 12 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Q: How to get rid of ListView flicker when adding/removing items

2. add items and removing items from a list

3. * MSHFlexGrid Remove Item and Add Item *

4. MSHFlexGrid Add Item, Remove Item

5. MSHFlexGrid Add Item and Remove Item

6. Need help adding/removing a menu item

7. Any Way To Stop All ListView Items From Blinking While Adding Items

8. ListView Control - Removing selected items from the list

9. Removing an item from a listview

10. Removing an item from a ListView

11. SHFileOp and removing corresponding items from ListView

12. removing items from a listview

 

 
Powered by phpBB® Forum Software