SPWebPartManager.CreateWebPartFromList 方法 (SPList, Boolean)

创建新的 Web 部件,可查看指定的列表并可以选择强制所选内容的ListViewWebPart类的日历列表的默认视图。

命名空间:  Microsoft.SharePoint.WebPartPages
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Shared Function CreateWebPartFromList ( _
    list As SPList, _
    forCustomToolpane As Boolean _
) As WebPart
用法
Dim list As SPList
Dim forCustomToolpane As Boolean
Dim returnValue As WebPart

returnValue = SPWebPartManager.CreateWebPartFromList(list, _
    forCustomToolpane)
public static WebPart CreateWebPartFromList(
    SPList list,
    bool forCustomToolpane
)

参数

  • forCustomToolpane
    类型:System.Boolean

    true返回为日历列表 ; ListViewWebPart类的实例否则为false。

返回值

类型:Microsoft.SharePoint.WebPartPages.WebPart
如果支持 XSLT 呈现视图的XsltListViewWebPart类和forCustomToolpane参数的参数的实例是false;否则为ListViewWebPart类的实例。

异常

异常 条件
ArgumentNullException

list参数的参数不能为空引用(无 在 Visual Basic 中)。

另请参阅

引用

SPWebPartManager 类

SPWebPartManager 成员

CreateWebPartFromList 重载

Microsoft.SharePoint.WebPartPages 命名空间