Thursday, May 1, 2008

Data View Connection

Say you have two lists called CompanyList1 and NewsList1.

Each company may contains one or more news in the news list. So in the NewsList1 List we created a lookup column called Company which points to the title column of CompanyList1.

Here is the task: If you want to customise the DispForm.aspx of the company list to also display a list of news that associated with the current company.

Here are the steps on how to do that:

1. Firstly, we will need to create a Data View to display News. Since the NewsList1 only have the company title as the reference rather than the companyID. We need to somehow filter the News dataview with the Company Title. So we could create a news data view to connect to the existing data view on the DispForm.aspx in order to get the company title.


2. Choose the NewsList1 as the data source for the new data view and click show data.

3. Select the rows you want to display.

4. Insert as multiple item view since there might be more than one news associated with the current company.

5. In the design mode, click the arrow icon on the top right of the created dataview. Choose Web Part Connections.

6. The NewsList1 needs to get parameter from the CompanyList1.



7. Create a new parameter called Title.

8. Link the Title parameter to the Title column of the CompanyList1.


9. In the design mode, click the arrow icon on the top right of the created dataview. Choose Filter. Make the company column of the NewsList1 equals to the Title parameter.

10. Save your changes, browse the page, you will see the news are filtered by the Company title.


blog comments powered by Disqus