Using SharePoint Web Part Connections

Problem

Displaying relative information in the form of a master - detail view is one of the most common UI requirements.

For instance, a company could have several departments, and departments could have several employees. In most cases, there would be separate list of department and employees. One can use the list viewer web part to show department and employees all together at same page. But consider a scenario where the requirement is to display employees of the corresponding department.

In this tip we will look at how to deal with this requirement in SharePoint using "Web Part Connections".

Solution

 "Web Part Connections" allow you to connect two different web parts on the same page. Conceptually speaking, one web part provides an input from a column to another web part's column. Depending upon the input, the target web part will get filtered. In this article, we will discuss how to use web part connections to solve the problem in question.

In the screenshot below, there are two list viewer web parts to display records from the Department List and the Employees List. The only common / matching data between the two lists is the DepartmentName column in Department List and the EmpDepartment column in Employees list. We will use this column to connect both web parts.



Select the Site Action -> Edit Page menu item.

As shown in the screenshot below, select Edit -> Connections -> Get Sort/Filter From -> Department. Here the Department web part placed as a separate web part above the employees web part.



Select Column DepartmentName for the Department List and Click on Next .



Select Column EmpDepartment for the Employees List and Click on Finish .



Click on Exit Mode.

Now you will be able to see two things:

  • A selection button will appear in front of source web part records. Selecting of a record in Department web part will act as input to the Employees web part
  • The corresponding records will get displayed in the target web part. The same can be seen in the screenshot below.





Now change the selection of DepartmentName to "Financial Securities" and you will notice the difference.



In summary, by using web part connections one can easily create master detail function linking between different web parts.

Next Steps

  • Use Web Part Connections to connect more than one web parts and filter the data.
  • Use Web Part Connections with business data catalog web parts to effectively sort third party data and display relative data
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值