We have a newslist that we want to sort using our own algorithm and we also want to set a maxcount on the list.
It seems like the maxcount is applied to the list before the sorting. We want to first sort the list and then show the first number (maxcount) of news. Can anyone see what we are doing wrong?
We have the datasource of the newslist as a property that we fill in the method AddPages.
protected void Page_Load(object sender, EventArgs e)
{
AddPages();
// Add custom sorting
NewsList1.SortBy = null;
NewsList1.Filter += new EPiServer.Web.WebControls.FilterEventHandler(Utils.SortPages);
NewsList1.DataBind();
}
protected void Page_Load(object sender, EventArgs e) { AddPages(); // Add custom sorting NewsList1.SortBy = null; NewsList1.Filter += new EPiServer.Web.WebControls.FilterEventHandler(Utils.SortPages); NewsList1.DataBind(); }