Solved

Adding an item to the top of a listview

Posted on 2004-10-18
5
189 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 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

Industry Leaders: 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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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