This documentation is archived and is not being maintained.

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.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5
Show: