How to add DataFormWebPart to the page in SharePoint ...



How to add DataFormWebPart to the page in SharePoint Designer 2010Contents TOC \o "1-3" \h \z \u How to add DataFormWebPart to the page in SharePoint Designer 2010 PAGEREF _Toc355293720 \h 1Open page in advanced mode PAGEREF _Toc355293721 \h 1Add DataFormWebPart to the page PAGEREF _Toc355293722 \h 1Add Data Source PAGEREF _Toc355293723 \h 3Add Fields to DataFormWebPart PAGEREF _Toc355293724 \h 4Add more fields PAGEREF _Toc355293725 \h 6Create DataFormWebPart on page without master page PAGEREF _Toc355293726 \h 7Issues PAGEREF _Toc355293727 \h 11Not able to see design mode – master page error PAGEREF _Toc355293728 \h 11Solution: PAGEREF _Toc355293729 \h 11DataView button is not enabled PAGEREF _Toc355293730 \h 11Solution: PAGEREF _Toc355293731 \h 11DataView Web Part or XsltView web part is added instead of DataForm. PAGEREF _Toc355293732 \h 11AddColumn and Filter buttons are not enabled PAGEREF _Toc355293733 \h 11Not able to add columns by Drag & Drop PAGEREF _Toc355293734 \h 12Data Source Details ‘Insert selected Field as..’ dropdown is disabled PAGEREF _Toc355293735 \h 12DataSource dropdown does not contain some options to select. PAGEREF _Toc355293736 \h 12Other issues PAGEREF _Toc355293737 \h 12Solution: PAGEREF _Toc355293738 \h 12Open page in advanced modeOpen SharePoint designerGo to Pages library or your pages locationClick on your page name (e. g. default.aspx) and then ‘Edit File’. If edit mode is not available, detach the page from page layout first (via context menu).Add DataFormWebPart to the pageSelect ‘Split’ mode on the bottom of page (1).Find web part zone in code and point cursor inside.(before </ZoneTemplate> tag (2))7461253035303323077461295580221169059271893911To insert DataFormWebPart we need to click Data View button (3) on Insert tab, but is disabled. Save the page and button should get enabled.Click Data View (1) and select Empty Data View (2).296335365503222178111557716711DataFormWebPart is added to the zone.Add Data Source-744155528462a2a35115564198522Now, we need to set Data Source. Point with cursor between <DataSources></DataSources> (1) tag, then select Insert tab (2), click Data Source button (3) (if disabled, save the page (2a), should get enabled) and select desired list as data source (e. g. Pages) (4). 26924001619253332302451123950441634490154622511Selected data source is added to the page (1). View is empty yet (2), data source fields are visible in Data Source Details window (3).49491901977390300343888802124063224478272116112711Add Fields to DataFormWebPartClick Insert Selected Fields as… dropdown (1) and select Multiple Item Form (2) from in Data Source Details window.2044496467912111823384149734222Select DataFormWebPart (clicking on first tag <WebPartPages:DataFormWebPart ..in code view (1) or on heading in design mode (1a)). Then select desired fields from Row node in Data Source Details window. We selected Approval Status and FileRef.Name field.Drag and drop them to selected web part in design mode. 46018452137410336005195238760022168338522352001a1a111506073850511Fields are displayed in page view now (1). Xsl stylesheet was generated (2) and you can adjust it as you wish. This Xsl code is used when XslLink property to some custom *.xsl file is not set. Now, Data View Tools tab enables to apply Filter, Paging or Add/Remove Columns.29057602269490113353435105029022Add more fieldsIn Data Source Details window internal field names are used. More user friendly option how to add fields is using Add/Remove Column button. A least one column has to be present in DataFormWebPart to enable this button (and related buttons in Options tab). Let’s add Title and URL Path field. Follow steps (1) to (4). 30581602881630443124835981075332162810143827522119126036195011 Fields are added to the web part in page view.Create DataFormWebPart on page without master pageGo to Pages librarySelect New (1) ASPX (2) file from context menu.4743452292985112200910251269522New file is created. Rename as you wish and click the name to open it. Click Edit file link and confirm advanced mode of page.215328513081002276263536512511Page is in edit mode and Data View button is enabled here (1). Cursor is set inside of <form> tag (2).Follow steps 6 – 11 to setup DataFormWebPart.Go to beginning of web part, place cursor to the very first tag <WebPartPages:DataFormWebPart (1), and select Select Tag from context menu (2). 328676023221952229210117919511All code part of webpart is selected. Copy it and paste to destination page between <ZoneTemplate> tags (1).119126068389511Go back to original empty aspx page , scroll up and copy registration tags (1).526796061150511Paste them to destination page at the beginning and remove duplicates. Tagprefix WebPartPages (1) was already in the page, so we added only SharePoint prefix registration (2). -1905096456511-115570154432022Save the page and check it on SharePoint. DataFormWebPart is added to the page.IssuesNot able to see design mode – master page errorIn some cases, after clicking on Split tab you can get following error (1) and even if you are in web part zone with cursor, Data View button is still disabled (2).After page save button is still disabled. 753110360045223105785216979511Solution: Create and setup DataFormWebPart in different page with correct master page or without master page (see chapter HYPERLINK \l "_Create_DataFormWebPart_on" Create DataFormWebPart on page without master page). Copy generated code with registrations to your page with master page error. Even if view is not visible in Sharepoint Designer, it should work on Sharepoint. DataView button is not enabledSolution:Check if you are with cursor in web part zone (between <ZoneTemplate> tags.If it doesn’t help, save the page.If it doesn’t help, create web part in empty page and copy code to your page afterwards (see chapter HYPERLINK \l "_Create_DataFormWebPart_on" Create DataFormWebPart on page without master page).DataView Web Part or XsltView web part is added instead of DataForm.This can happen if you have clicked in wrong place selecting fields or have moved fields to the wrong place in document. DataFormWebPart is empty then and new XsltListViewWebPart is added. Remove it and try again.AddColumn and Filter buttons are not enabledYou have to have at least column in DataView dropped from Data Source Details window.Not able to add columns by Drag & DropThis can happen if you have clicked in wrong place when selecting fields or have moved fields to the wrong place in document. Remove web part and try again.Data Source Details ‘Insert selected Field as..’ dropdown is disabledThis dropdown is enabled only until some fields are moved to view. If you want to change item in dropdown, remove web part and re-create it. Use dropdown after data source selection.DataSource dropdown does not contain some options to select.I cannot reproduce it now, but it may happen. Strange.Other issuesError after recreating dataformwebpart linked on Pages library.Solution:Restart Sharepoint Designer and create web part with data source again. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download