“Data View Preview” in SharePoint Designer 2010
When editing a data view in SharePoint 2010, using SharePoint Designer 2010, on the <Design> tab, there’s a section called <Preview>. This title is a little misleading, because there are some pretty powerful options in this section, having to do with inline editing. Jennifer Mason wrote about “SharePoint 2010- Inline Editing for Views”, which shows how to set up a list or library view with inline editing. As is apparent, the view does not need to be created in SharePoint Designer in order to use inline editing, it can just be a regular browser view. In this post, I’ll describe a way to create a data view web part using SharePoint Designer 2010, and some extra functionalities that exist when inline editing is used.
- Open the SharePoint 2010 site in SharePoint Designer 2010.
- Click “Lists and Libraries” on the left side of the screen, and then click on the name of the list or library to modify. In this example, the list is called “Sales Report”.
- On the right side of this page, in the Views section, click <New…> to create a new view. I’m going to be creative and call mine “Custom” and click OK.
- Then, click the name of the view to edit it. All list view web parts are data view web parts in SharePoint 2010, so there’s no worry about breaking the page away from the site definition at this point.
- When any part of the list view in the middle of the page is selected, the contextual ribbon at the top of the page will display the <List View Tools> set of tabs. On the <Options> tab, click the Inline Editing button. This toggle button will insert a seemingly empty column into the left side of the list. Again, Jennifer Mason’s blog shows examples of what inline editing looks like on a list item.
- Click on the <Design> tab, and now that inline editing is turned on, there will be a couple of more configurations possible. In the Preview section of this tab, click the Data View Preview drop-down box.
The Edit Template and Insert Template choices are only available when inline editing is turned on.
Edit Template – This is the interface that displays in inline edit mode on any individual item in the list.
Insert Template – This interface is used when the “Plus” icon is clicked to add a new item to the list in an inline fashion. Editing the insert template will change the way this screen appears.These screens were not easily configurable in SharePoint 2007.
- There is another cool new option in this “Data View Preview” section, unrelated to inline editing. This is the option to edit the ‘No Matching Items’ Template. Back in the days of SharePoint 2007, when we wanted to change the text displayed when there were no items in a view, we could do only that… edit the text. An example of a case in which to use this functionality: There is a lit of tasks, filtered by tasks assigned to the logged in user. Instead of the default “There are no items to show in this view…”, the text can be changed to something more specific, like “There are currently no tasks assigned to you”. Now in SharePoint 2010, there’s the ability to edit that whole page that is displayed where there are no items in the view. In the Data View Preview drop-down box, choose ‘No Matching Items’ Template.
- In this example, I edited the text, and also inserted an exclamation mark image.