______________________________________________________________________________
This blog has been discontinued. Please visit my new site based on a completely different concept:
Sharepoint Resource Center
______________________________________________________________________________
I’m a big fan of SharePoint Designer data view feature. Data view allows me to take a data source (e.g. a SharePoint list) and present the underlying data in a format requested by clients/users.
Earlier today I created a Data View in SharePoint Designer but then decided it would be a good idea to add the View as an extra view in the original list (my data source for the Data View). This turned out to be fairly straightforward.
1) I created an extra list view (SPD) using the usual method (browser>list toolbar>Views>Create View).
2) I opened the page with my custom Data View (test1.aspx) in SharePoint Designer, selected my Data View by clicking the WebPartPages:DataFormWebPart element in design view and copied it to my clipboard.
3) I opened the site containing the list I was working with in SharePoint Designer, I could now see that next to AllItems.aspx, DispForm.aspx, EditForm.aspx and NewForm.aspx there’s a SPD.aspx page created in step 1 (the page contained the new SPD list view).
4) I opened the list in Design View, clicked on the existing webpart (WebPartPages:ListViewWebPart element), and placed my cursor below it. I could then paste my custom Data View I copied in step 2 onto the page.
5) I saved the page and opened it in a browser. I now had a page with 2 views – one configured through the GUI and one created using SPD (screenshot below)

6) The last thing I needed to do is to hide the top view (created through the GUI) so that only my custom Data View is visible. This was can be done by checking the “Hidden” checkbox in the Layout section of the web part property.
Note: The original view web part has to be hidden. If you delete it instead the page itself will be disassociated from the list and will disappear from the Views drop down list.
End result:
The list’s Views drop-down displays my new view page
Choosing the SPD view takes me to my new page and displays my custom Data View.
By the way, the custom view was needed as my client didn’t want to see the grouping heading displayed (e.g. he wanted it to be “Asia” rather than “Region: Asia”). He also wanted the view to add the “Desktops” values of every item in a given group and display the sum in the group heading. That can be easily achieved by using a bit of xsl. As It’s a useful trick and an often required feature I will try to blog about it soon.
Filed under: Sharepoint Designer

