pkaiser

Comments on Web Part Connections

Blog Post created by pkaiser Employee on Dec 5, 2008

Our customers and partners often express interest in creating their own web parts that can connect to RtWebParts. If you’re interested, the first thing that you should know is that RtWebParts are based on the SharePoint web part base class, and not the ASP.NET web part base class. When RtWebParts was first introduced, the ASP.NET web part base class did not yet exist. We have not yet migrated to the newer ASP.NET web part base class, primarily because we’re fond of some of the features that are only available from the SharePoint web part base class, most notably the support for client-side connections. Though it is more difficult to find documentation and examples, you are more likely to successfully create web parts that connect to RtWebParts if you too use the SharePoint web part base class.

 

Speaking of client-side connections, you might have noticed that in the past RtWebParts supported identical data via two different connection interfaces: IRowProvider, and IParametersOutProvider. One reason for this was to open the possibility to connecting to as many third-party parts as we could. However, though both interfaces provide the same data, there is a slight difference in implementation: our implementation of the IParametersOutProvider interface supports both client- and server-side connections, whereas the IRowProvider implementation supports only server-side connections. There are two important implications of this. First, when you’re creating a web part page and want to connect two RtWebParts together, using the IParametersOutProvider interface to connect them will cause the connection to occur on the client side, whereas using the IRowProvider interface will require server-side connections, meaning the entire page will refresh when data is sent from the provider part to the consumer part. Second, when creating your own custom web parts, if you want to connect them to RtWebParts and support client-side connections in doing so, you must implement the IParametersOutProvider interface for client-side connections, because that’s the only interface that RtWebParts can consume for client-side connections.

 

Note that the IRowProvider and IParametersOutProvider interfaces are both associated with the original SharePoint web part base class, and not the ASP.NET web part base class. Don’t confuse them with ASP-NET-related web part connection interfaces like IWebPartRow.

 

One last note on connections – as of RtWebParts version 2.0, our web parts that can serve as providers in a web part connection can also act as filter parts, providing data to consuming web parts using the ASP.NET ITrasnformableFilterValues interface. This is particularly useful in connecting RtWebParts that provide context, such as RtTimeRange, to the Excel Web Access web part, which can be used with our DataLink for Excel Services product to display DataLink spreadsheets in a SharePoint web part page.

Outcomes