1. XsltListViewWebPart
在SharePoint Designer 2010里,如果直接从”Data View”里拖个List到WebPartZone里,那么默认的就是一个XsltListViewWebPart 类型的 WebPart。
优点:
里边的样式和脚本都封装好了,不用做太多额外的更改;
缺点:
不可以自定义修改
2. DataFormWebPart
有两种方法可以添加DataFormWebPart 类型的WebPart,
方法一:数据源=当前Site的List和Document Libraries,可以在”Data View”里先拖一个”Empty Data View”,然后选择一个数据源,最后从右边的”Data Source Details”拖一些Column进来;
方法二:数据源=其他Site(包括Parent Site和 Sub Site)的List和Document Libraries,可以通过SOAP Service Connection 建立数据连接,然后在”Data View”里就会发现多了一项”SOAP Service”,我们新建的数据源就在里边,把它拖到Webpart Zone里默认就是DataFormWebPart 类型。
优点:
定制能力比较强;
缺点:
脚本要自己写,比如Add New Item的时候,弹出窗口的脚本;
这里要想实现”Show link to item”和”Show lint to edit menu”比较困难,可以参照下面的方法:
To the best of my knowledge you can't add the EditControlBlock (ECB) menu to a DataView (DataForm) web part. You can however turn on edit links in the DataForm web part properties (last tab in the properties panel) using SharePoint Designer. This will add an Edit link to the left end of each row in the web part. Clicking it will shift the row into edit mode. You will then see a Save/Cancel link where the edit link used to be. You can also turn on Insert and Delete links in the same properties panel.
Come From: http://www.go4sharepoint.com/Forum/data-view-web-part-edit-menu-10227.aspx
3. Help links:
2. http://msdn.microsoft.com/en-us/library/ff630941(office.14).aspx
3. http://blog-sharepoint.blogspot.com/2009/05/data-view-conditional-formatting-using.html