Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Class FilterPropertySort

A filter to sort a PageDataCollection by the values for a property.

Inheritance
System.Object
FilterPropertySort
Implements
System.Collections.Generic.IComparer<PageData>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Filters
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class FilterPropertySort : PageFilterBase, IPageFilter, IContentFilter, IComparer<PageData>
Remarks

If you want to define your own sort filter on a webcontrol that inherits from PageListData, you must ensure that the default sort filter is not added to the filter queue. Should you forget to do this the results of your sort filter will be resorted by the default sort filter which always executes last.

Constructors

FilterPropertySort()

Initializes a new instance of the FilterPropertySort class.

Declaration
public FilterPropertySort()

FilterPropertySort(String)

Initializes a new instance of the FilterPropertySort class.

Declaration
public FilterPropertySort(string sortBy)
Parameters
Type Name Description
System.String sortBy

The name of the property that should be used to sort the pages.

FilterPropertySort(String, FilterSortDirection)

Initializes a new instance of the FilterPropertySort class.

Declaration
public FilterPropertySort(string sortBy, FilterSortDirection sortDirection)
Parameters
Type Name Description
System.String sortBy

The name of the property that should be used to sort the pages.

FilterSortDirection sortDirection

The sort direction.

Properties

CompareInfo

Define this object to do culture-sensitive string-comparison. When this System.Globalization.CompareInfo object is defined, all string-comparisons use this object.

Declaration
public CompareInfo CompareInfo { get; set; }
Property Value
Type Description
System.Globalization.CompareInfo
Remarks

Only strings are sorted using this object. All other datatypes are sorted using default culture.

SortBy

Gets or sets the name of the property that is used to sort the pages.

Declaration
public string SortBy { get; set; }
Property Value
Type Description
System.String

The name of the property that is used to sort the pages.

SortDirection

The sort direction.

Declaration
public FilterSortDirection SortDirection { get; set; }
Property Value
Type Description
FilterSortDirection

Methods

Compare(PageData, PageData)

Compares the specified pages.

Declaration
public int Compare(PageData page1, PageData page2)
Parameters
Type Name Description
PageData page1

The first page.

PageData page2

The second page.

Returns
Type Description
System.Int32

An integer with the results of the comparison.

Filter(PageDataCollection)

Filters the specified pages.

Declaration
public override void Filter(PageDataCollection pages)
Parameters
Type Name Description
PageDataCollection pages

The pages that should be filtered.

Overrides

ShouldFilter(IContent)

If the content should be filtered.

Declaration
public override bool ShouldFilter(IContent content)
Parameters
Type Name Description
IContent content
Returns
Type Description
System.Boolean

True if the filter will remove the page; otherwise false.

Overrides

ShouldFilter(PageData)

If the page should be filtered.

Declaration
public override bool ShouldFilter(PageData page)
Parameters
Type Name Description
PageData page

The page that you want to check.

Returns
Type Description
System.Boolean

True if the filter will remove the page; otherwise false.

Overrides
Remarks

FilterPropertySort does not support ShouldFilter method.

Implements

System.Collections.Generic.IComparer<T>

Extension Methods