DataPager.FindPageableItemContainer Method

Definition

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

protected:
 virtual System::Web::UI::WebControls::IPageableItemContainer ^ FindPageableItemContainer();
protected virtual System.Web.UI.WebControls.IPageableItemContainer FindPageableItemContainer ();
abstract member FindPageableItemContainer : unit -> System.Web.UI.WebControls.IPageableItemContainer
override this.FindPageableItemContainer : unit -> System.Web.UI.WebControls.IPageableItemContainer
Protected Overridable Function FindPageableItemContainer () As IPageableItemContainer

Returns

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

Exceptions

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.

Remarks

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.

Applies to

See also