Hi.
We want to sort a PageDataCollection according to the value of the PageChildOrderRule property. It works fine on the PageName property, but not on anything else. Do anyone know what I need to do here?
CODE:
FilterSortOrder filter = (FilterSortOrder)CurrentPage.Property["PageChildOrderRule"].Value;
FilterPropertySort sorter;
FilterEventArgs eArgs = new FilterEventArgs(children);
switch (filter.ToString())
{
case ("Alphabetical"):
sorter = new FilterPropertySort("PageName" , (FilterSortDirection.Ascending));
sorter.Filter(this, eArgs);
break;
case ("CreatedDescending"):
sorter = new FilterPropertySort("Created", (FilterSortDirection.Descending));
sorter.Filter(this, eArgs);
break;
case ("CreatedAscending"):
sorter = new FilterPropertySort("Created", (FilterSortDirection.Ascending));
sorter.Filter(this, eArgs);
break;
case ("ChangedDescending"):
sorter = new FilterPropertySort("Changed", (FilterSortDirection.Descending));
sorter.Filter(this, eArgs);
break;
case ("Rank"):
sorter = new FilterPropertySort("Created", (FilterSortDirection.Ascending));
sorter.Filter(this, eArgs);
break;
case ("PublishedAscending"):
sorter = new FilterPropertySort("StartPublish", (FilterSortDirection.Ascending));
sorter.Filter(this, eArgs);
break;
case ("PublishedDescending"):
sorter = new FilterPropertySort("StartPublish", (FilterSortDirection.Descending));
sorter.Filter(this, eArgs);
break;
default:
break;
}
Hi
I think the problem is that when accessing the properties programmatically you need to add the prefix "Page". So, instead of "Created" use "PageCreated", instead of "StartPublish" use "PageStartPublish", and so on...
That's why only sorting by PageName work.