I am using SDL Tridion 2013 SP1 and using the Core Service to retrieve all the categories in the SDL Tridion system. Below is my code:
TaxonomiesFilterData taxFilter = new TaxonomiesFilterData();
taxFilter.SortExpression = "Title";
XElement items = client.GetListXml("tcm:0-10-1", taxFilter);
Here client
is a SessionAwareCoreServiceClient
client and tcm:0-10-1
is a valid Publication ID
I am able to retrieve all the categories in the publication successfully, however, the issue is that they are not in a Sorted order as I wish to get them in sorted by their title (same as it happens in the CME).
Further, I have even tried using the Item Selector Community extension (created by Bart) but I am also getting the same result (non-sorted list of categories).
Any help will be highly appreciated.