Sort order problem

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
Oct 07, 2005 14:06
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
Oct 07, 2005 14:53
be nice if you posted some code as there may be others who have the same problem... give and take.
Oct 11, 2005 16:38
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
Oct 12, 2005 10:36
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);
Oct 13, 2005 12:26
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
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.