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.
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.Booleantrue 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:
-
Both the providerConnectionPoint and consumerConnectionPoint are Windows SharePoint Services 2.0 connection interfaces.
-
The provider or consumer Web Part is not in a zone.
-
Either the consumer or provider Web Part is closed.
-
Either the providerConnectionPoint or consumerConnectionPoint cannot participate in a connection.
-
Multiple connections are attempted on the providerConnectionPoint or consumerConnectionPoint and the connection does not support multiple connections.
-
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.