Microsoft.SharePoint.WebPar ...


DataFormWebPart Class (Microsoft.SharePoint.WebPartPages)
An XSLT-rendering Web Part that receives its data (XML/XPathNavigable objects) from a DataSourceControl control.

Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Syntax

Visual Basic (Declaration)
<ParseChildrenAttribute(True)> _
<XmlRootAttribute(Namespace:="http://schemas.microsoft.com/WebPart/v2/DataView")> _
<SupportsAttributeMarkupAttribute(True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
Public Class DataFormWebPart
    Inherits BaseXsltDataWebPart
    Implements IDesignTimeHtmlProvider, IPostBackEventHandler, IWebPartRow, ICallbackEventHandler, _
    IConnectionData
Visual Basic (Usage)
Dim instance As DataFormWebPart
C#
[ParseChildrenAttribute(true)] 
[XmlRootAttribute(Namespace="http://schemas.microsoft.com/WebPart/v2/DataView")] 
[SupportsAttributeMarkupAttribute(true)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
public class DataFormWebPart : BaseXsltDataWebPart, IDesignTimeHtmlProvider, IPostBackEventHandler, IWebPartRow, 
    ICallbackEventHandler, IConnectionData
Inheritance Hierarchy

System.Object
   System.Web.UI.Control
     System.Web.UI.WebControls.WebControl
       System.Web.UI.WebControls.Panel
         System.Web.UI.WebControls.WebParts.Part
           System.Web.UI.WebControls.WebParts.WebPart
             Microsoft.SharePoint.WebPartPages.WebPart
               Microsoft.SharePoint.WebPartPages.BaseXsltDataWebPart
                Microsoft.SharePoint.WebPartPages.DataFormWebPart
                   Microsoft.SharePoint.Search.Internal.WebControls.CoreResultsWebPart
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Tags :


Community Content

AmosFiveSix1231234
Example of some of the markup for this object

I've removed some of the misc parameters, but this gives you a good idea of the major portions of the markup. The main elements below the DataFormWebPart element are DataSources, ParameterBindings, DataFields and Xsl.

<WebPartPages:DataFormWebPart runat = "server" ListName = "{CF1A38EA-B2C1-48EA-8F4C-8D6AC5EBF12B}" DisplayName = "Project Tasks">
<DataSources>
<SharePoint:SPDataSource runat = "server" DataSourceMode = "List" SelectCommand = "&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='Project' Type='Integer' LookupId='True'&gt;&lt;/FieldRef&gt;&lt;Value Type='Integer'&gt;{0}&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;" UseInternalName = "True" ID = "Project_x0020_Tasks1">
<SelectParameters>
<WebPartPages:DataFormParameter ParameterKey = "ListID" PropertyName = "ParameterValues" DefaultValue = "{CF1A38EA-B2C1-48EA-8F4C-8D6AC5EBF12B}" Name = "ListID"></WebPartPages:DataFormParameter>
<asp:QueryStringParameter QueryStringField = "ID" Name = "0"></asp:QueryStringParameter>
</SelectParameters>
</SharePoint:SPDataSource>
</DataSources>
<ParameterBindings>
<ParameterBinding Name = "ListID" Location = "None" DefaultValue = "{CF1A38EA-B2C1-48EA-8F4C-8D6AC5EBF12B}"/>
<ParameterBinding Name = "dvt_apos" Location = "Postback;Connection"/>
<ParameterBinding Name = "UserID" Location = "CAMLVariable" DefaultValue = "CurrentUserName"/>
<ParameterBinding Name = "Today" Location = "CAMLVariable" DefaultValue = "CurrentDate"/>
<ParameterBinding Name = "StartPosition" Location = "Postback" DefaultValue = ""/>
<ParameterBinding Name = "ProjectID" Location = "QueryString(ID)"/>
</ParameterBindings>
<DataFields>@Title,Title;@Priority,Priority;@FileRef,URL Path;</DataFields>
<Xsl>
.....
</Xsl>
</WebPartPages:DataFormWebPart>


AmosFiveSix1231234
Great blog post on Use SPDataSource with DataFormWebPart

From the SharePoint Designer team blog: http://blogs.msdn.com/sharepointdesigner/archive/2007/04/24/spdatasource-and-rollups-with-the-data-view.aspx

(from the comments) "You won’t be able to edit the DataSource of a DataFormWebPart without opening SPD..."

Tags :

Page view tracker