Add to My Yahoo! | Google Reader or Homepage | Add to Windows Live | Add to Windows Live Alerts

Wictor Wilén

SharePoint Server MVP / Author / MCT / MCTS / MCP / MSc writing about SharePoint and other interesting Microsoft technologies

Web Parts Connections - Introduction

Posted at 2009-08-26 12:35 by Wictor Wilén in .NET , SharePoint , Web Parts with 6 comments.

This is the first post in a series on Web Parts Connections. This spring I had a series on Web Part Properties that I think was very successful, they got some good comments and feedback and they get a lot of hits from search engines. Please help me out and evolve this new series of posts with some feedback and questions.

What is Web Parts Connections?

imageWeb Parts Connections allows you to connect the Web Part server controls so that they can exchange information. Web Parts can either be a consumer and/or a provider. Once you connect a consumer with a provider the consumer starts receiving data from the provider, all this is done on the server side. Web Parts can be constructed in such way that it can have several consumer and provider connection-points, i.e.it can consume or provide information from several different sources. A provider connection-point can have several consumers but a consumer connection-point can have only one provider.

The image, to the right, illustrates in the top; one Web Part connected to another. The middle sample shows how one provider Web Part is connected to two consumer Web Parts. The sample in the bottom shows a consumer Web Part that have two consumer end-points that are connected to two different provider Web Parts.

Note: Web Parts Connections are a part of the ASP.NET 2.0 framework

Why Connecting Web Parts?

When you connect Web Parts you enhance the experience for the user. You can for example have one Web Part containing a list of items and let that one act as a provider and then have a consumer Web Part that shows detailed information of the item selected in the provider Web Parts.

In SharePoint most of the default Web Parts are either consumers or providers. For example, with some easy clicks in the interface you can connect lists and make one a consumer and the other provider.

Connecting Custom Lists Filtering

The image above shows two custom lists that are connected. The Regions list contains the names of the regions, used in the Sales list. With this simple action we have built a Filter Web Part to filter our Sales list. More about Filter Web Parts later on in the series. The left image shows how you make the actual connection and the image to the right shows you how you can filter the Sales list using the radio buttons on the Regions list.

I've been working a lot building dashboards and applications for BI-solutions and similar. Using connected Web Parts have both made the end-user experience a whole lot better (and more good looking) as well as the development of the dashboards.

 

This was an introduction to Web Parts Connections, the next part will be up in a couple of days.

Until next time.

Comments and trackbacks

#  I have a question by Karthik Nallajalla
Screenshot from websnpr Nice post Wictor, I just implemented as you mentioned in your post. And I had a question, when Regions list web part is connected to Sales list web part. By default, none of the values in Regions list are selected and Sales list shows all the items. is there any way to have a default selection of an item in the Regions list to have Sales list to be filtered instead of showing all items initially.
#  I have a question by Karthik Nallajalla
Screenshot from websnpr Nice post Wictor, I just implemented as you mentioned in your post. And I had a question, when Regions list web part is connected to Sales list web part. By default, none of the values in Regions list are selected and Sales list shows all the items. is there any way to have a default selection of an item in the Regions list to have Sales list to be filtered instead of showing all items initially.
#  @Karthik by Wictor
Screenshot from websnpr Hi, thank you. I don't think that you can set a default filter value to the list view webparts OOTB. However you can work around it; either you can use some JavaScript to set the value or check the Url when you have set a filter. Then you should see that there are a View and a SelectedId parameter (like this ...http://server/Pages/Connected1.aspx?View={16DFDD47-A0BD-4372-9F86-DA1642CEED2D}&SelectedID=3) You can always link to that page/address
#  Thanks Wictor by Karthik Nallajalla
Screenshot from websnpr I can't use your work around in my case, I have three list web parts, in which two of the list web parts used to filter the third one. I can apply your work around to only one list. Actually every time when there is a selection in the filter list then there will be a post back. So I can't apply a value selection on my second list. Anyhow thank you for your reply.
#  @Karthik by Wictor
Screenshot from websnpr Okie, not everything can be solved with the out-of-the-box features. If you are in for some programming, watch this space as I'll continue the series in a few days.
#  Thanks Wictor by Karthik Nallajalla
Screenshot from websnpr Thanks for your response Wictor.
Make a comment on this post:
Subject:  

Your name:  
Your Url:  
Note: submissions may have to be approved before being visible, so don't submit your comment multiple times.
Real Time Web Analytics