London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Sort order problem

Vote:
0
I have a template that includes a date-element, kind of like the Starting-date used in calendar. I want to be able to sort these elements based on this date-element. How do I do this? Is there a way I can add my date-element to the standard dropdown-list setting sorting order? Thanx in advance! Frank
#12391
Oct 07, 2005 14:06
Vote:
0
Nevermind! Sometimes I post my problem before I start thinking. Of course, the PageList can be used for this task. Have a nice one! Frank
#14181
Oct 07, 2005 14:53
Vote:
0
be nice if you posted some code as there may be others who have the same problem... give and take.
#14182
Oct 11, 2005 16:38
Vote:
0
It's in the SDK. PageListData class (base class for most of the listcontrols), property SortBy. Takes a PropertyName, sort the list based on that. Works together with SortDirection were you can select Ascending or Descending. /Håkan
#14183
Oct 12, 2005 10:36
Vote:
0
Ok I was thinking more along the lines of some code that might help someone having problems with sorting... anyway, here's some for the noobs: PageDataCollection oPages = Global.EPDataFactory.FindPagesWithCriteria(p, col); oPages.Add (GetPage(p)); FilterSort sorter; if (sortOrder == _ASC) sorter = new FilterSort(FilterSortOrder.PublishedAscending); else sorter = new FilterSort(FilterSortOrder.PublishedDescending); sorter.Sort(oPages);
#14184
Oct 13, 2005 12:26
Vote:
0
Sorry for not including code, but the solution was so simple I thought I was the only one not seeing it. Anyways, I used the PageList like this: Frank
#14185
Nov 01, 2005 9:05
* 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.