Click here to Skip to main content
15,881,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have a custom treectrl class and i want insert some items into tree,is there any possible way to insert items in a sorted order(last created file should display first). Basicaly the treectrl which i have created is used as listctrl so each item is automatically become parent and no parent has children.
I can not use SortChildren() beacause no items are inserted as child.

What I have tried:

I tried to get filecreation time,and sort basis of it,but i can't sort after getting file creation time.
Posted
Updated 1-Dec-16 21:21pm

1 solution

For that you must cleary separate the visual display (View) and the data source (Model).
Your data sounds more than a ordered list or an array. Insert the data ordered and than reload the data.

The list control has a lot of possibilities, so take a look at the articel Using the List Control. It has option for adeactivating ordering or setting a sort function (for callback ordering).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900