Export (0) Print
Expand All

DataPager.FindPageableItemContainer Method

Retrieves the data-bound control that is associated with the DataPager control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

protected virtual IPageableItemContainer FindPageableItemContainer()

Return Value

Type: System.Web.UI.WebControls.IPageableItemContainer
The data-bound control that is associated with the DataPager control.

ExceptionCondition
InvalidOperationException

A control that implements the IPageableItemContainer interface was not found on the page.

-or-

The control specified by the PagedControlID property does not implement the IPageableItemContainer interface.

-or-

The DataPager control does not have a naming container.

The data-bound control retrieved by this method references a data source object that contains the data that the DataPager control pages. For the DataPager control to be able to page this data, the data-bound control must implement the IPageableItemContainer interface.

The FindPageableItemContainer method checks whether the PagedControlID property is set to the ID of a data-bound control. If the PagedControlID property is not set, the FindPageableItemContainer method goes up the stack of naming containers to look for a data-bound control. For example, if the DataPager control is inside the ListView.LayoutTemplate template of a ListView control, the PagedControlID property does not have to be set. This is because the FindPageableItemContainer method can automatically find the ListView control by examining the control tree.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft