IListProvider Interface

The IListProvider interface defines events that a Web Part can implement so that it can provide an entire list (rowset) of data to a another Web Part that implements the IListConsumer interface.

Events

The following table shows the events of the IListProvider interface and a brief description of each.

Name Description
ListProviderInit Occurs when a Web Part that implements the IListProvider interface initializes its list of field names and (optionally) a list of field display names.
ListReady Occurs when the entire list has been retrieved and is ready to be sent to a Web Part that implements the IListConsumer interface.
PartialListReady Occurs when the first batch or page of data is ready to be sent to a Web Part that implements the IListConsumer interface.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

The IListProvider interface should be implemented in Web Parts that need to pass a collection of data that can be characterized as a list, such as a table of data. It can be used in scenarios where the consumer part was designed with an understanding of the data being sent by the provider. Also, a Web Part that implements the IListProvider interface has the ability to pass initialization arguments to the consumer part. Connecting the IListProvider interface to the IListConsumer interface is a direct connection, so no transformer dialog is displayed.

Example

The following code example shows a simple server-side IListProvider Web Part. It can be connected to one or more Web Parts that implement the IListConsumer interface on the server. This example displays a list of products. When the Fire ListReady button is clicked, this Web Part passes the entire list of products to all other Web Parts that are connected to it.

There are 8 steps specific to making this a connectable Web Part. These steps are numbered and commented in the following sample code.

For an overview of the steps of creating a connectable Web Part, see Creating a Connectable Web Part.

Requirements

Namespace: Microsoft.SharePoint.WebPartPages.Communication

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security