Try our conversational search powered by Generative AI!

SortOrder vs SortBy


Where can I find information on what properties these two sort functions have?

There's nothing in the manual or SDK.


Oct 28, 2009 10:24

The SortBy property defines the field (page property) to sort the results, e.g. PageName in the example on this link:

List pages example.

There is also the property faqItemLister.SortDirection to define the ascending or descending order of the result:

faqItemLister.SortDirection = EPiServer.Filters.FilterSortDirection.Ascending

SortOrder uses the enum from EPiServer.Filters.FilterSortOrder, e.g. EPiServer.Filters.FilterSortOrder.CreatedAscending. I do not know which takes precendance.

Oct 28, 2009 12:16


And how do I go about sorting by name, then by date?



Edited, Oct 28, 2009 12:43

I have just modified some code on our system and this displays correctly:

<EPiServer:NewsList ID="newsLister" runat="server" SortBy="PageName" SortDirection="Ascending">

Initially I tried it without the SortDirection attribute and found that it sorts by descending by default. We were using:

<EPiServer:NewsList ID="newsLister" runat="server" SortOrder="PublishedDescending">

This is in a user control rather than an ASPX page. Do you have any code defining the sort criteria in your code behind?

I do not know the answer to your question on sorting by two fields.

Edited, Oct 28, 2009 13:05

Thanks. Got it :)


Maybe some other ppl might know how to sort articles by date / name - name / date.


Oct 28, 2009 13:07

Oct 28, 2009 18:04
* 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.