Given below is the problem description -
We are trying to programmatically connect the 'RtTreeView' web part with another web part and pass "NodePath" as a parameter to that consumer web part. The consumer web part in this case is a Microsoft SSRS Report Viewer web part.
We are using SharePoint OM to achieve this.
(We are using MS SharePoint 2007 SP2, PIAF 18.104.22.16870 and PI Webparts 22.214.171.124 versions.)
But, we are getting a "NullReferenceException" when we try to get the provider connection points of the 'RtTreeView' web part.
Any help on this is greatly appreciated!
Given below is the code which is throwing error(The line at which we are seeing the error is highlighted in yellow):
using (SPLimitedWebPartManager manager = web.GetLimitedWebPartManager("http://server/sites/sitecoll/page.aspx", PersonalizationScope.Shared))
TreeViewWP treeView = null;
foreach (Microsoft.SharePoint.WebPartPages.WebPart webPart in manager.WebParts)
treeView = webPart as TreeViewWP;
ProviderConnectionPointCollection providerColl = manager.GetProviderConnectionPoints(treeView);
foreach (ProviderConnectionPoint item in providerColl)
We beleive the connection is programatically possible in Sharepoint and below is the link for some more info on this: http://kkryczka.wordpress.com/2011/01/12/preferred-rtwebpart-connections/#comment-1