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)

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

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:

  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.

See also

Reference

SPWebPartManager class

SPWebPartManager members

Microsoft.SharePoint.WebPartPages namespace