• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Adding an item to the top of a listview

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
wildzero
Asked:
wildzero
  • 3
  • 2
1 Solution
 
Wim ten BrinkSelf-employed developerCommented:
Have you tried
  ListView1.Items.Insert(0)
instead of
  ListView1.Items.Add
??? :-)

Easy 50 points... :-P
0
 
wildzeroAuthor Commented:
Gave ya another 10 for the quick reply.
Thats super excellent - thank you sir!
0
 
Wim ten BrinkSelf-employed developerCommented:
You're welcome. :-)
0
 
Wim ten BrinkSelf-employed developerCommented:
Don't forget to click the "Accept" button if you think this question is answered to your complete satisfaction. ;-)
0
 
wildzeroAuthor Commented:
oh yea
I knew that :P
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now