Sort a pagedatacollection via property

new FilterPropertySort(“PageName”, FilterSortDirection.Descending).Filter(children);

Tags: , , ,

  1. Arun’s avatar

    Dear Erik,
    Using the above said method i got a PageDatacollection is sorted order (sorted with PageName Property). But in the sorted PDC i need to apply another sort Using Pagename. Suppose if Page Name/PageID is in This collection A/12,B/11,C/13,A/14,B/15,C/16…..Now
    new FilterPropertySort(“PageName”, FilterSortDirection.Descending).Filter(children); Will give me a result like A/14,A/12,B/15,B/11,C/16,C/13.

    Rather I need like A/12,A/14,B/11,B/15,C/13,C/16… Plz help me to resolve this Problem…

  2. Erik Nordin’s avatar

    Hmm, you could try to first sort by PageLink and then by PageName.
    If that doesn’t work I guess you have to write your own Comparer which first checks the PageName, if they are equal then check the PageLink ID.

    Good luck.

  3. James Gaisford’s avatar

    Great tip.

    This post just saved me hours!

    Thanks.

Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>