problem with ListView control

Hello,
I have a little problem with ListView control. I have two items in ListView control and I want to insert one item between them.

eg:
I have this:
-----------------------------------------
col |
-----------------------------------------
item_one |
item_three |
-----------------------------------------

and I want to insert an item between item_one and item_two:

-----------------------------------------
col1 |
-----------------------------------------
item_one |
item_two |
item_three |
-----------------------------------------

I tried using ListView_InsertItem but it inserts items at the end and I get this:

-----------------------------------------
col1 |
-----------------------------------------
item_one |
item_three |
item_two |
-----------------------------------------

Any ideas how can I do this?
Thanks for help!
I think there is overload function insert that accapts position.
What are you using to determine their position in the list?
I´m not sure if the following approach is effecient, but couldn´t You "just" create an list/array/vector of your items and insert the new item in there, so all You need is to repopulate the ListView with the items from the vector.

EDIT: http://msdn.microsoft.com/en-us/library/bb761192%28v=VS.85%29.aspx <- this may help
Last edited on
Topic archived. No new replies allowed.