Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • 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 BrinkCommented:
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 BrinkCommented:
You're welcome. :-)
0
 
Wim ten BrinkCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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