Try our conversational search powered by Generative AI!

SortBy NewsList

Vote:
 

I have  a news list and I want to sort it by a data property, If i put the Sort by in the ascx file it works (see below) but I want to do the sorting via the code behind; however when i try NewsListCtrl.SortBy["MyDateControl"] it agrues saying its not an int? So why does it not complain when the ascx file has the same thing?

<EPiServer:NewsList PageLinkProperty="Review" ID="NewsListCtrl" runat="server" SortBy="ReviewDate" >

#19861
May 09, 2008 13:20
Vote:
 

You could try to sort your newslists like this instead and see if it works

 NewsListCtrl.SortBy = "ReviewDate";

#19864
May 09, 2008 14:16
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.