The provided function works on my side, and for your convenience I have attached my project to this thread. Please note that the sort function works such as in the Window OS - it sorts the files and the directories separately(when you use the View->Arrange Icons by->Name
In case that you still experience the problem, please rework it in order to replicate your setup, open a new support ticket and send it back. I will check the project and do my best provide a solution. Also please provide information about the exact version of the control that you use.
the Telerik team