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字串,包含檢視的名稱。
strCollViewFields
Type: System.Collections.Specialized.StringCollection集合,其中包含檢視欄位的內部名稱。
strQuery
Type: System.String共同作業應用程式標記語言(連同 CAML) 字串,包含查詢的Where子句。
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.Booleantrue ,讓該檢視的預設檢視。否則, false。
type
Type: Microsoft.SharePoint.SPViewCollection.SPViewType指定的檢視類型的列舉型別值。
bPersonalView
Type: System.Boolean若要建立個人的檢視 ; true若要建立公用viewfalse。
傳回值
Type: Microsoft.SharePoint.SPView
新的檢視。
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | 指定的檢視類型不正確的清單範本類型。 |