IRowConsumer Interface
The IRowConsumer interface enables a Web Part to communicate with a Web Part that implements the IRowProvider Interface (or that supports a suitable transformer) to work with a row of data.
Microsoft.SharePoint.WebPartPages.Communication.IRowConsumer
Public Methods
The following table shows the methods of the IRowConsumer interface and a brief description of each.
| Name | Description |
|---|---|
| RowProviderInit(object, Microsoft.SharePoint.WebPartPages.Communication.RowProviderInitEventArgs) | Initialization event. This event handler is of type RowProviderInitEventHandler. |
| RowReady(object, Microsoft.SharePoint.WebPartPages.Communication.RowReadyEventArgs) | Received after a selected row or rows change (for example, when a row is updated or selected). |
Thread Safety
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
Remarks
The IRowConsumer interface should be implemented in Web Parts that need to consume a collection of data that can be characterized as a row, such as a row in a table. The IRowConsumer interface has the ability to receive initialization arguments from the provider Web Part. When connecting a Web Part that implements the IRowConsumer interface to a IRowProvider Web Part, the connection is direct, so no transformer dialog box will be displayed. To use the passed values appropriately, the consuming Web Part may need to be designed with an understanding of the schema of the data being sent by the provider Web Part.
Example
The following code example shows a simple Web Part that implements the IRowConsumer interface and supports running its connection implementation only on the server. It can be connected to another Web Part that implements the IRowProvider interface on the server. Its user interface displays the row of values received from the IRowProvider Web Part.
There are 7 steps specific to making this a connectable Web Part. These steps are numbered and commented in the following code sample.
Requirements
Namespace: Microsoft.SharePoint.WebPartPages.Communication
Platforms: Microsoft Windows ServerĀ 2003
Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)
Security: Code Access Security