Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Cannot see webpart connections in code

  Asked By: Caitlin Simmons         Date: Apr 28, 2010      Category: Sharepoint      Views: 355
 

I have a web page with 2 webpart connections:
1. Two list webparts that I connected using Edit Page in SharePoint
GUI.
2. A data view (consumer) that I created with SP Designer, connected
to a list web part (provider).

Now, I want to find all the connections in this code:

SPFile file = web.GetFile("http://sites/sp/default.aspx");
SPLimitedWebPartManager wpMgr =
file.GetLimitedWebPartManager(PersonalizationScope.Shared);
SPWebPartConnectionCollection connections =
wpMgr.SPWebPartConnections;

Surprisingly, wpMgr.SPWebPartConnections is always empty !!!

Then I tried to loop through all the webparts and check their
ConnectionID and Conections members.
These members were valid only for the consumer of the 1st connections.
The 2nd connection (dataview/list) did not appear in any webpart!

So how can I find such connections (involving dataviews) in code?

(Note: I tried to create the 2nd connection either from Designer or
from Edit Page, but the results are the same).


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:            

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Cannot see webpart connections in code Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].