This week in the forums, and interesting scenario was brought up. The user had a list of projects and a document library that had a lookup to associate each document with a project. They wanted to create a custom edit form that not only allowed them to edit the project content, but also showed all related documents. Here is a screenshot of the desired solution:
The steps to building this solution are as follows:
Create a custom edit form (I will give step by step instructions in a future blog post).
Add a DVWP to the new page that contains the projects list data.
Create a Parameter based on the ID that is passed in the Query String.
Filter the Web Part Based on the parameter you created.
Configure the web part to be hidden on the page.
Add the Documents Library Web Part to the Page.
Configure to show columns and desired layout.
Convert to a DVWP.
Create a data connection to the Projects Web part that filters the documents based on the value in the projects list.
Here are some screenshots of the final solution, notice the Value in ID and how it feeds the values in the web parts.
The reason that the DVWPs were necessary in this solution is because of the way web part connections work. If we did not create DVWPs we could not create a connection that passed data on the page load, instead users would have to select the radio button of the projects list. If you haven’t spent time looking at the differences in web part connections between LVWPs and DVWPs I would encourage you to do it!