Problem with TVirtualStringTree and alphabetical order lazarus / 31-LCL ---------------------------------------------------------------------- pusuni · 2018-11-05 11:05 Hi. I've wrote some code for using VirtualStringTree like a file manager. In the capture one you can see. I've define one order for file positions too: alphabetical order. That's works properly. https://image.ibb.co/hFjeYL/Sin-t-tulo0.jpg Now I change  the name of file. For example "Windows 10.txt" to "aWindows 10.txt" (capture two) https://image.ibb.co/bRyj00/Sin-t-tulo1.jpg but the new file with the new name is not in the right place. When I move the mouse out of control and i make a click in other control and now I return to the previous control, the orden in the tree changes and the file is put  in the right place (capture three)  https://image.ibb.co/iNrRDL/Sin-t-tulo2.jpg How can I do that immediately I press the return key? I've test witn Repaint, Refresh and invalidate but I get negative results. The tree doesn't change. How can I force a repaint of the tree nodes? Thanks in advanced ---------------------------------------------------------------------- balazsszekely · 2018-11-05 11:57 You should sort the tree when the OnEdited event is called(editing has finished): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i VirtualStringTree1.SortTree(0, sdAscending);The above code will sort the first column in ascending order. ---------------------------------------------------------------------- pusuni · 2018-11-05 12:48 Thanks a lot That's fixed the issue