Freigeben über


How to Create a Data View that Shows a Single Item

When you first insert a Data View, the default "look" is always a tabular multi-item view; however, it's easy to change this to whatever style you want. We even include a few pre-built styles in the box that you can quickly switch between. To change the style of your view, go to the Data menu and click "Style...". From the "View Styles" dialog that pops up, you can change between a few different styles.

Quick example: One of the more common types of views you'll often want to create is a "single item" item view. 

Step 1: Create a tabular Data View that includes the fields you want to end up in the single item view:

Step 2: Click Data/Styles and choose the forth style - repeating form with border. Your view should now look something like this:

Step 3: The last step is to change the view so that it only shows one record. You can do this by clicking Data/Styles again and going to the "Options" tab of the View Styles dialog. At the bottom of the dialog is a section called "record sets", where you can change how many records are shown in your view. For the single item view scenario, we want to "limit the total number of items" to 1.

Voila, you now have a view showing just one item. The only thing left to do is filter the view to the specific item you care about :).

Next time, I'll show you how you can use a feature called "Web Part Connections" to allow users to dynamically filter a single item view from a "master" multi-item view.