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
Syntax
'Declaration
Public Function CanSPConnectWebParts ( _
provider As WebPart, _
providerConnectionPoint As ProviderConnectionPoint, _
consumer As WebPart, _
consumerConnectionPoint As ConsumerConnectionPoint, _
transformer As WebPartTransformer _
) As Boolean
'Usage
Dim instance As SPWebPartManager
Dim provider As WebPart
Dim providerConnectionPoint As ProviderConnectionPoint
Dim consumer As WebPart
Dim consumerConnectionPoint As ConsumerConnectionPoint
Dim transformer As WebPartTransformer
Dim returnValue As Boolean
returnValue = instance.CanSPConnectWebParts(provider, _
providerConnectionPoint, consumer, _
consumerConnectionPoint, transformer)
public bool CanSPConnectWebParts(
WebPart provider,
ProviderConnectionPoint providerConnectionPoint,
WebPart consumer,
ConsumerConnectionPoint consumerConnectionPoint,
WebPartTransformer transformer
)
Parameters
provider
Type: System.Web.UI.WebControls.WebParts.WebPartThe Web Part that provides data to consumer when the controls are connected.
providerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ProviderConnectionPointThe connection point that acts as a callback method so that provider can participate in a connection.
consumer
Type: System.Web.UI.WebControls.WebParts.WebPartThe Web Part that receives data from provider when the controls are connected.
consumerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ConsumerConnectionPointThe connection point that acts as a callback method so that consumer can participate in a connection.
transformer
Type: System.Web.UI.WebControls.WebParts.WebPartTransformerA WebPartTransformer that enables an incompatible provider and consumer to connect. a null reference (Nothing in Visual Basic) 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.
Remarks
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.