IRowProvider Interface
The IRowProvider interface enables a Web Part to send a row of data to a Web Part that implements the IRowConsumer, ICellConsumer, IFilterConsumer, or IParametersInConsumer interface.
Microsoft.SharePoint.WebPartPages.Communication.IRowProvider
Events
The following table shows the events of the IRowProvider interface and a brief description of each.
| Name | Description |
|---|---|
| RowProviderInit | The initialization event. |
| RowReady | Sent when the selected row changes, such as when a row is updated or selected. |
Thread Safety
Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
Remarks
The IRowProvider interface should be implemented for Web Parts that need to pass a collection of data that can be characterized as a row, such as a row in a table. It can be used in scenarios where the consumer Web Part was designed with an understanding of the data schema being sent by the provider. Also, a Web Part that implements the IRowProvider interface has the ability to pass initialization arguments to the consumer part. The IRowProvider interface can connect to more interfaces than any other connection interface. It can connect to ICellConsumer, IRowConsumer, IFilterConsumer, and IParametersInConsumer interfaces. Also, server-side implementations of the IRowProvider interface can be connected to Web Parts on a different page by using a Windows SharePoint Services–compatible Web Page editor, such as Microsoft Office FrontPage 2003. Connecting the IRowProvider interface to an IRowConsumer interface is a direct connection so no transformer dialog box will be displayed. When connecting the IRowProvider interface to the ICellConsumer, IFilterConsumer, or IParametersInConsumer interface, a transfomer dialog box will be displayed which allows an end user to map the row values between the parts. In this case, the consuming part doesn't need to be designed with knowledge of the data schema being sent by the provider Web Part because the end user is performing the mapping. However, this does require a user with a deeper understanding of the functionality of the Web Parts.
Example
The following code example shows a simple Web Part that implements the IRowProvider interface only for connections that run on the server. It can be connected to one or more Web Parts which implement the ICellConsumer, IRowConsumer, IFilterConsumer, or IParametersInConsumer interface on the server. This example displays a list of products with a selection button for each row. When the button is clicked, this Web Part will pass the row to all other Web Parts which are connected to it.
There are 9 steps specific to making this a connectable Web Part. These steps are numbered and commented in the code example.
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