Beja Expert Licensed User Longtime User Jan 20, 2015 #1 Hi, I have a listview with a few items, one of them is time 10:35AM (for example) I want to sort the ListView on this item. Your help is appreciated. p.s. A function or module will help a lot
Hi, I have a listview with a few items, one of them is time 10:35AM (for example) I want to sort the ListView on this item. Your help is appreciated. p.s. A function or module will help a lot
Erel B4X founder Staff member Licensed User Longtime User Jan 20, 2015 #2 You can sort standard Lists. So you will need to add the items to a List. Sort the list and then add the items to the ListView. Upvote 0
You can sort standard Lists. So you will need to add the items to a List. Sort the list and then add the items to the ListView.
Beja Expert Licensed User Longtime User Jan 20, 2015 #3 Thanks Erel, but standard list doesn't support more than two items (I think).. my listview has raws of 9 items each Upvote 0
Thanks Erel, but standard list doesn't support more than two items (I think).. my listview has raws of 9 items each
udg Expert Licensed User Longtime User Jan 20, 2015 #4 Hi Beja, standard list are designed to hold objects not only primitive types. So you may define a type with those 9 items you need and then add to the list an object instance of that type. In pseudo code: Code: .. type mytype=(item#1 as string, item#2 as int...) dim myobject as mytype myobject.item#1 = "john" mybject.item#2 = 1 .. mylist.add(myobject) Upvote 0
Hi Beja, standard list are designed to hold objects not only primitive types. So you may define a type with those 9 items you need and then add to the list an object instance of that type. In pseudo code: Code: .. type mytype=(item#1 as string, item#2 as int...) dim myobject as mytype myobject.item#1 = "john" mybject.item#2 = 1 .. mylist.add(myobject)
Beja Expert Licensed User Longtime User Jan 20, 2015 #5 Hi udg, How is the list sorted then.. I have an item of type Time among the 9 items, that I want the list sorted with. Upvote 0
Hi udg, How is the list sorted then.. I have an item of type Time among the 9 items, that I want the list sorted with.
udg Expert Licensed User Longtime User Jan 20, 2015 #6 Have a look at List.SortType in the standard list documentation. It does what you need. Upvote 0