共用方式為


SPWebPartManager.CreateWebPartFromList method (SPList, Boolean)

建立新的 Web 組件的檢視指定的清單,並選擇性地強制的行事曆] 清單的預設檢視的ListViewWebPart類別的選取範圍。

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
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
    Type: System.Boolean

    返回行事曆] 清單中 ; 的ListViewWebPart類別的執行個體的true否則, false。

傳回值

Type: Microsoft.SharePoint.WebPartPages.WebPart
如果支援 XSLT 呈現檢視的XsltListViewWebPart類別和forCustomToolpane參數的引數的執行個體是false。否則, ListViewWebPart類別的執行個體。

Exceptions

Exception Condition
ArgumentNullException

list參數的引數不能a null reference (Nothing in Visual Basic)。

請參閱

參照

SPWebPartManager class

SPWebPartManager members

CreateWebPartFromList overload

Microsoft.SharePoint.WebPartPages namespace