This topic has not yet been rated - Rate this topic

SPWebPartManager.CanSPConnectWebParts Method

Checks the Web Parts that will be participating in a connection to determine whether the SPWebPartConnection can be used to form a connection between them.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
public bool CanSPConnectWebParts(
	WebPart provider,
	ProviderConnectionPoint providerConnectionPoint,
	WebPart consumer,
	ConsumerConnectionPoint consumerConnectionPoint,
	WebPartTransformer transformer
)

Parameters

provider
Type: System.Web.UI.WebControls.WebParts.WebPart
The Web Part that provides data to consumer when the controls are connected.
providerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ProviderConnectionPoint
The connection point that acts as a callback method so that provider can participate in a connection.
consumer
Type: System.Web.UI.WebControls.WebParts.WebPart
The Web Part that receives data from provider when the controls are connected.
consumerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ConsumerConnectionPoint
The connection point that acts as a callback method so that consumer can participate in a connection.
transformer
Type: System.Web.UI.WebControls.WebParts.WebPartTransformer
A WebPartTransformer that enables an incompatible provider and consumer to connect. null can be passed if the providerConnectionPoint and the consumerConnection point have the same interface type.

Return Value

Type: System.Boolean
true if the SPWebPartConnection can be used to form a connection between the Web Parts; otherwise, false.

This method will return false under any of the following conditions:

  1. Both the providerConnectionPoint and consumerConnectionPoint are Windows SharePoint Services 2.0 connection interfaces.

  2. The provider or consumer Web Part is not in a zone.

  3. Either the consumer or provider Web Part is closed.

  4. Either the providerConnectionPoint or consumerConnectionPoint cannot participate in a connection.

  5. Multiple connections are attempted on the providerConnectionPoint or consumerConnectionPoint and the connection does not support multiple connections.

  6. The consumerConnectionPoint and providerConnectionPoint interfaces are not the same type and a transformer was either not provided or the transformer does not support the interface types required by the providerConnectionPoint or the consumerConnectionPoint.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ