How to reverse listview?

  • Thread starter Thread starter Jozef Jarosciak
  • Start date Start date
J

Jozef Jarosciak

Hi, my program is adding (every hour) a line to listview and into its 7
columns.

Problem is that it is adding it to the bottom of the list, so after
couple of hours, my users need to scroll down to see the most recent
results.

What I'd like is to have some function to reverse listview order after
I add the line. (chronologically)

Thanks.

Jozef Jarosciak
 
Instead of listview.Items.Add( "New Item"), try listview.Items.Insert( 0,
"New Item" ). That should insert the new item at index 0.
 
Hi Jozef,

In addition to Phil's answer, you may also want to check out the ListView.EnsureVisible(index) method that will scroll if necessary to ensure the item is visible.
 
Back
Top