Try our conversational search powered by Generative AI!

SortOrder vs SortBy

Vote:
 

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

There's nothing in the manual or SDK.

 

#34066
Oct 28, 2009 10:24
Vote:
 

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.

#34087
Oct 28, 2009 12:16
Vote:
 

 

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

 

 

#34089
Edited, Oct 28, 2009 12:43
Vote:
 

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.

#34090
Edited, Oct 28, 2009 13:05
Vote:
 

Thanks. Got it :)

 

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

 

#34091
Oct 28, 2009 13:07
Vote:
 

http://world.episerver.com/FAQ/Items/How-do-I-sort-pages-by-multiple-properties/

#34110
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.