Solved

Adding an item to the top of a listview

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now