SPWebPartManager.CanConnectWebParts Method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
Checks the Web Parts that will be participating in a connection to determine whether they can be connected, and uses a WebPartTransformer object to create the connection between an incompatible consumer and provider.
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Overrides Function CanConnectWebParts ( _
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.CanConnectWebParts(provider, _
providerConnectionPoint, consumer, _
consumerConnectionPoint, transformer)
public override bool CanConnectWebParts(
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 ProviderConnectionPoint 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 ConsumerConnectionPoint 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.
Return Value
Type: System.Boolean
true if the Web Parts can be connected; otherwise, false.
Remarks
This override will return false under any of the following conditions:
The two Web Parts cannot be connected.
The providerConnectionPoint or consumerConnectionPoint is a Windows SharePoint Services 2.0 connection interface.
Either provider or consumer Web Parts are not in a zone.
CanSPConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer) returns false.