Solved

Adding an item to the top of a listview

Posted on 2004-10-18
5
186 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
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 60 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 137
Newbie Thread Programming 1 154
Installshield for Embarcadero EX 10.1 Berlin 4 42
How to make Sign in, using Clientdataset? 1 19
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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