Class PageListData
Base data control for accessing page list.
Implements
Inherited Members
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7Syntax
public class PageListData : PageControlBase, INotifyPropertyChanged, IPageControl, IEnumerable, IPageSource, INamingContainer
Remarks
You can derive from this class to create custom controls generating any type of listing.
Constructors
PageListData()
Initializes a new instance of PageListData
Declaration
public PageListData()
Properties
EnableVisibleInMenu
Gets or sets whether to recognize the "visible in menu" setting for pages.
Declaration
public bool EnableVisibleInMenu { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxCount
Restrict listing to a maximum number of pages.
Declaration
public int MaxCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Default value is -1 which means "Show all pages". Note that 0 menas no pages.
PagesPerPagingItem
Number of pages that goes into one paging item. The default value is same as PagesPerPagingItem.
Declaration
public int PagesPerPagingItem { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This property overrides any similar values provided in any control defined in the PagingControl property.
If you are using a data binding expression for this property, you need to manually DataBind this control as we cannot guarantee that AutoBind works.
Examples
For example, if PagesPerPagingItem is 12, each paging item will list up to 12 pages.
PageTypeID
Predefined sort orders instead of using custom sorting by setting SortBy
Declaration
public int PageTypeID { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Paging
Controls if paging is used. Set to true to enable paging.
Declaration
public bool Paging { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
By default paging is disabled.
If you are using paging in your PageListData control and you are using a data binding expression make sure to manually DataBind it as we cannot guarantee that AutoBind works.
PagingControl
Control used to render paging controls. By default an instance of PagingControl is returned. The default control can be replaced by a custom paging control.
Declaration
public PagingControl PagingControl { get; set; }
Property Value
Type | Description |
---|---|
PagingControl |
Remarks
If you are using paging in your PageListData control and you are using a data binding expression make sure to manually DataBind it as we cannot guarantee that AutoBind works.
PagingFooterTemplate
Footer template for the paging items.
Declaration
public ITemplate PagingFooterTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Web.UI.ITemplate |
PagingHeaderTemplate
Header template for the paging items.
Declaration
public ITemplate PagingHeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Web.UI.ITemplate |
SkipCount
Skip the first x pages in listings
Declaration
public int SkipCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
SortBy
Custom sorting on a property instead of using predefined sorting by setting SortOrder
Declaration
public string SortBy { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SortDirection
Direction for sorting listings specified by SortBy
Declaration
public FilterSortDirection SortDirection { get; set; }
Property Value
Type | Description |
---|---|
FilterSortDirection |
SortOrder
Predefined sort orders instead of using custom sorting by setting SortBy
Declaration
public FilterSortOrder SortOrder { get; set; }
Property Value
Type | Description |
---|---|
FilterSortOrder |
Methods
CreatePagingControls(PageDataCollection)
Creates the paging controls.
Declaration
protected virtual void CreatePagingControls(PageDataCollection pages)
Parameters
Type | Name | Description |
---|---|---|
PageDataCollection | pages | The pages. |
CreatePostSortFilters()
Called once when the control needs access to post sort filters used for modifying a PageDataCollection.
Declaration
protected override void CreatePostSortFilters()
Overrides
Remarks
Override this method to customize the population of filters to run after sorting occurs.
Typical use is to limit the number of pages, for example by using FilterCount or FilterSkipCount
CreatePreSortFilters()
Called once when the control needs access to pre sort filters used for modifying a PageDataCollection.
Declaration
protected override void CreatePreSortFilters()
Overrides
Remarks
Override this method to customize the population of filters to run before sorting occurs.
Typical use is to add pages to create a combined list from two or more folders, or to remove pages based that should not appear in listing. For example by using FilterCompareTo
CreateSortFilters()
Called once when the control needs access to sort filters used for modifying a PageDataCollection.
Declaration
protected override void CreateSortFilters()
Overrides
Remarks
Override this method to customize the population of sorting filters.
Typically used to change the order between pages, for example with FilterPropertySort.
LoadControlState(Object)
Loads the paging index.
Declaration
protected override void LoadControlState(object savedState)
Parameters
Type | Name | Description |
---|---|---|
System.Object | savedState | The state from control state. |
OnInit(EventArgs)
Called when the page is in the init state of the lifecycle
Declaration
protected override void OnInit(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs object that contains the event data. |
PopulatePages(PageDataCollection)
Called once when the control is populating the collection of pages
Declaration
protected override void PopulatePages(PageDataCollection pages)
Parameters
Type | Name | Description |
---|---|---|
PageDataCollection | pages | Collection to populate with pages |
Overrides
Remarks
Override this method to customize the population of pages, if this control has been data bound the collection may already contain pages.
Examples
Example how a list control may choose to implement this method
protected override void PopulatePages(PageDataCollection pages)
{
if(PageLink.ID!=0)
GetChildren(PageLink,pages);
}
PreparePagingControls(PageDataCollection)
Prepares the paging controls.
Declaration
protected virtual void PreparePagingControls(PageDataCollection pages)
Parameters
Type | Name | Description |
---|---|---|
PageDataCollection | pages | The pages. |
SaveControlState()
Stores the paging index.
Declaration
protected override object SaveControlState()
Returns
Type | Description |
---|---|
System.Object | The index to store in control state. |