Fileview sort the elements by date
Posted
#1
(In Topic #1213)
Trainee
I would like to know how to sort the elements by date in a fileview, considering that I have a "showpreview" display.
Posted
Guru

Posted
Guru

You can hack the IconView inside the FileView
Remember this conversation…
Gambas One - Gambas ONE
You could set the IconView "Sorted" property to false and do it yourself.
Posted
Guru

Code (gambas)
- ' make an array of the keys and an array of the modified dates...
- aKeys.Add(sKey)
- ' sort the list by date, swapping keys along with dates
- ' (this sort function might need some work but it looks like it works to me)
- ReCheck:
- Goto ReCheck
- ' make the IconView match the list order by going through the list in reverse moving each item key to the top of the iconview.
- iv.MoveTo(aKeys[c])
- iv.Item.MoveFirst()
- ' now it is in date order
Posted
Trainee
Posted
Guru

toto96 said
Many thanks for your help! It works perfectly.
No worries.
btw if you want to reverse the order just reverse the 2 arrays before moving the items…
1 guest and 0 members have just viewed this.



