?
Solved

Adding an item to the top of a listview

Posted on 2004-10-18
5
Medium Priority
?
191 Views
Last Modified: 2010-04-05
Hey there

Lets say i have a listview with 5 items and 4 colums, when I add an item, I would like it to be added to the top instead of the bottom, so basically everything either has to be shuffled down or moved out, new item added and then all the old stuff moved back in (from what I can gather). So what would be the fastest way to do this?

Faster and cleaner the code, the more points I will give ;)
0
Comment
Question by:wildzero
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 240 total points
ID: 12337085
Have you tried
  ListView1.Items.Insert(0)
instead of
  ListView1.Items.Add
??? :-)

Easy 50 points... :-P
0
 
LVL 10

Author Comment

by:wildzero
ID: 12337093
Gave ya another 10 for the quick reply.
Thats super excellent - thank you sir!
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12337210
You're welcome. :-)
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12340412
Don't forget to click the "Accept" button if you think this question is answered to your complete satisfaction. ;-)
0
 
LVL 10

Author Comment

by:wildzero
ID: 12341686
oh yea
I knew that :P
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question