集合中具有指定的名称、 视图字段、 查询、 联接、 投射的字段、 行限制,视图类型和指定是否为默认视图,以及是否视图是个人或公共视图是否显示项目按页的布尔值创建视图。
命名空间: Microsoft.SharePoint
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
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
类型:System.String一个包含视图的名称的字符串。
strCollViewFields
类型:System.Collections.Specialized.StringCollection一个包含视图字段的内部名称的集合。
strQuery
类型:System.String协作应用程序标记语言(CAML) 字符串,包含查询Where子句。
strJoins
类型:System.String一个包含查询的联接的 CAML 字符串。
strProjectedFields
类型:System.String一个包含查询的投射的字段的 CAML 字符串。
iRowLimit
类型:System.UInt32项在视图中返回的最大数目。指定的值大于Int32.MaxValue (2147483647 或十六进制 0x7FFFFFFF) 将引发异常,因为值超出范围。
bPaged
类型:System.Booleantrue 指定视图支持显示详细项目按页 ;否则为 false。
bMakeViewDefault
类型:System.Boolean若要使视图的默认视图 ; true 否则为 false。
type
类型:Microsoft.SharePoint.SPViewCollection.SPViewType枚举值,指定视图的类型。
bPersonalView
类型:System.Booleantrue创建个人视图 ;若要创建公共viewfalse。
返回值
类型:Microsoft.SharePoint.SPView
新的视图。
异常
| 异常 | 条件 |
|---|---|
| InvalidOperationException | 指定的视图类型为列表模板类型无效。 |