共用方式為


SPViewCollection.Add method (String, StringCollection, String, String, String, UInt32, Boolean, Boolean, SPViewCollection.SPViewType, Boolean)

建立具有指定的名稱、 檢視欄位、 查詢、 聯結、 預計的欄位、 列數限制、 檢視類型,以及指定檢視是否要顯示項目頁面,是否預設檢視,以及檢視是個人還是公用的布林值集合中的檢視。

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

Syntax

'宣告
Public Function Add ( _
    strViewName As String, _
    strCollViewFields As StringCollection, _
    strQuery As String, _
    strJoins As String, _
    strProjectedFields As String, _
    iRowLimit As UInteger, _
    bPaged As Boolean, _
    bMakeViewDefault As Boolean, _
    type As SPViewCollection.SPViewType, _
    bPersonalView As Boolean _
) As SPView
'用途
Dim instance As SPViewCollection
Dim strViewName As String
Dim strCollViewFields As StringCollection
Dim strQuery As String
Dim strJoins As String
Dim strProjectedFields As String
Dim iRowLimit As UInteger
Dim bPaged As Boolean
Dim bMakeViewDefault As Boolean
Dim type As SPViewCollection.SPViewType
Dim bPersonalView As Boolean
Dim returnValue As SPView

returnValue = instance.Add(strViewName, _
    strCollViewFields, strQuery, strJoins, _
    strProjectedFields, iRowLimit, bPaged, _
    bMakeViewDefault, type, bPersonalView)
public SPView Add(
    string strViewName,
    StringCollection strCollViewFields,
    string strQuery,
    string strJoins,
    string strProjectedFields,
    uint iRowLimit,
    bool bPaged,
    bool bMakeViewDefault,
    SPViewCollection.SPViewType type,
    bool bPersonalView
)

參數

  • strViewName
    Type: System.String

    字串,包含檢視的名稱。

  • strJoins
    Type: System.String

    連同 CAML 字串,包含聯結的查詢。

  • strProjectedFields
    Type: System.String

    連同 CAML 字串,包含查詢的預估的欄位。

  • iRowLimit
    Type: System.UInt32

    若要在檢視中傳回的項目最大數目。指定的值大於Int32.MaxValue (2147483647 或十六進位的 0x7FFFFFFF),因為值超出範圍,會擲回例外狀況。

  • bPaged
    Type: System.Boolean

    若要指定檢視支援顯示更多的項目頁面 ; true 否則, false。

  • bMakeViewDefault
    Type: System.Boolean

    true ,讓該檢視的預設檢視。否則, false。

  • bPersonalView
    Type: System.Boolean

    若要建立個人的檢視 ; true若要建立公用viewfalse。

傳回值

Type: Microsoft.SharePoint.SPView
新的檢視。

Exceptions

Exception Condition
InvalidOperationException

指定的檢視類型不正確的清單範本類型。

請參閱

參照

SPViewCollection class

SPViewCollection members

Add overload

Microsoft.SharePoint namespace