Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ListView - how to add item to the front of the list

windows8.1 store app project-

I have a ListView which is bound to an ObservableCollection of items in the ViewModel. I add an item to said Collection, and execute a sort method which places the added item at the beginning of the list. The Collection updates, but the ListView places the item in the end (right most end basically).

Since the app's requirement is to show the items from left to right (in order of date), I'm in a bind :/

How do I fix this?

like image 538
Oyiwai Avatar asked Dec 21 '25 20:12

Oyiwai


1 Answers

Use collection.Insert(0, item); to insert an item at the beginning of the collection.

like image 62
Nick Avatar answered Dec 23 '25 11:12

Nick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!