Tried to use custom code for populating multilist with sorted desired certain items of certain template sorted by publish date, after implementing code successfully, results in the multilist weren't as expected, however after debugging it turns out in the code the list has been successfully sorted but in the sitecore multilist it comes up sorted alphabetically only not as sorted in code , any idea what's wrong here ?
public class RelatedArticlesCustomSort : IDataSource
{
public Item[] ListQuery(Item item)
{
Log.Info($"Start ListQuery with item {item}", typeof(RelatedArticlesCustomSort));
item = Context.ContentDatabase?.GetItem("/sitecore/content/WorkZen/WorkZen/Home/Content");
List<Item> relatedArticles = item?.Axes?.GetDescendants()?.Where(i => i.TemplateID.ToString().Equals("{DEDF4A7F-87CD-40F8-BA00-21F77313A044}")).ToList();
Item[] relatedArticlesSorted = relatedArticles.OrderByDescending(d => d[FieldIDs.PublishDate]).ToArray();
return relatedArticlesSorted;
}
}