UpdateView Method

Last modified: March 09, 2015

Applies to: SharePoint Foundation 2010

Modifies the specified view of a list.


<Method ID="Text">
  <SetList Scope="Request">GUID</SetList>
  <SetVar Name="Cmd">NewView</SetVar>
  <SetVar Name="ViewType">HTML</SetVar>
  <SetVar Name="LocalizedTodayString">Text</SetVar>
  <SetVar Name="LocalizedMeString">Text</SetVar>
  <SetVar Name="ListVersion">0</SetVar>
  <SetVar Name="ViewFPModified">[TRUE|FALSE]</SetVar>
  <SetVar Name="ViewOrderk">k+1_Text</SetVar>
  <SetVar Name="ShouldDisplayTitle">[TRUE|FALSE]</SetVar>
  <SetVar Name="ShouldDisplayExpires">[TRUE|FALSE]</SetVar>
  <SetVar Name="SortFieldm">Text</SetVar>
  <SetVar Name="SortAscendingm">[TRUE|FALSE]</SetVar>
  <SetVar Name="IsThereAQuery">[TRUE|FALSE]</SetVar>
  <SetVar Name="FieldPickern">Text</SetVar>
  <SetVar Name="OperatorPickern">Eq</SetVar>
  <SetVar Name="CompareWithValuen"></SetVar>
  <SetVar Name="NextIsAndn">[TRUE|FALSE]</SetVar>
  <SetVar Name="GroupField1">Text</SetVar>
  <SetVar Name="GroupAscending1">[TRUE|FALSE]</SetVar>
  <SetVar Name="GroupField2">Text</SetVar>
  <SetVar Name="GroupAscending2">[TRUE|FALSE]</SetVar>
  <SetVar Name="CollapseGroups">[TRUE|FALSE]</SetVar>
  <SetVar Name="TotalText">COUNT</SetVar>
  <SetVar Name="ViewStyle">Integer</SetVar>
  <SetVar Name="RowLimit">Integer</SetVar>
  <SetVar Name="Paged">[TRUE|FALSE]</SetVar>
</Method>

Parameter

Description

ID = "Text"

Application-specific string. In an HTML editor compatible with Microsoft Windows SharePoint Services, such as Microsoft Office SharePoint Designer 2007, the string provides the sequence number and name of the method.

Scope = "Request"

When set to Request, the Scope attribute sets the variable for the scope of the enclosing Method element, unless the variable is changed by another tag.

Name = "Cmd"

Must be set to UpdateView.

ViewType = "Text"

Specifies the type of view to create. Possible values include Calendar, Grid, and HTML.

LocalizedTodayString = "Text"

Specifies the string used to return today's date. For example, [Today].

LocalizedMeString = "Text"

Specifies the string used to return the current user. For example, [Me].

ListVersion = "Integer"

Specifies the version of the list.

ViewFPModified = "[TRUE|FALSE]"

Specifies whether the view has been modified in Microsoft Office SharePoint Designer 2007 to such a degree that it cannot be modified in the browser.

ViewOrdern = "n+1_Field"

Specifies the order in which to display the specified field, where n represents an integer and Field represents the internal name of the field. For example, ViewOrder2="3_Title" specifies that the Title field is the third column displayed in relation to other columns that are displayed. The ShouldDisplayField parameter must also be specified to display the field.

ShouldDisplayField = "[TRUE|FALSE]"

Specifies whether a given field should be displayed in the view, where Field represents the internal name of the field. The ViewOrdern parameter must also be specified to display the field.

SortFieldn = "tp_Field"

Specifies a field to sort by in the view, where Field represents the internal name of the field.

SortAscendingn = "[TRUE|FALSE]"

Specifies whether the field represented by the SortFieldn parameter is sorted in ascending order.

IsThereAQuery = "[TRUE|FALSE]"

Specifies whether a filter is included in the view.

FieldPickern = "Field"

Specifies the internal name of a field by which to filter, where n is an integer between 1 and 10.

OperatorPickern = "Text"

Specifies the operator to use in the filter, where n is an integer that matches FieldPickern. Possible values include the following:

Eq — Equal to

Neq — Not equal to

Geq — Greater than or equal to

Leq — Less than or equal to

Gt — Greater than

Lt — Less than

BeginsWith — Begins with

Contains — Contains

CompareWithValuen = "Value"

Specifies the value against which to compare FieldPickern, where n is an integer that matches FieldPickern.

NextIsAndn = "[TRUE|FALSE]"

Specifies an AND condition when an additional filter is defined, where n is an integer that matches FieldPickern.

GroupField1 = "Text"

Specifies the internal name of a first field to group by.

GroupAscending1 = "[TRUE|FALSE]"

Specifies whether the first group-by field is sorted in ascending order.

GroupField2 = "Text"

Specifies the internal name of a second field to group by.

GroupAscending2 = "[TRUE|FALSE]"

Specifies whether the second group-by field is sorted in ascending order.

CollapseGroups = "[TRUE|FALSE]"

Specifies whether group-by fields are collapsed by default in the view.

TotalField = "COUNT"

Specifies that a Total row be displayed for the Field column.

ViewStyle = "0"

Specifies a style for the view as defined in VWSTYLES.XML in the site definition's XML folder. Possible values include the following:

0 — Basic Table

6 — Picture Library Details

12 — Boxed, no labels

13 — Boxed

14 — Document Details

15 — Newsletter

16 — Newsletter, no lines

17 — Shaded

18 — Issues Boxed

19 — Issues Boxed, no labels

RowLimit = "Integer"

Specifies the number of items to display per page through the view.

Paged = "TRUE"

Specifies whether the view is paged, which means that when the value of RowLimit is surpassed, additional items are displayed on subsequent pages.

<Method ID="UpdateView">
  <SetVar Name="Cmd">UpdateView</SetVar>
  <SetList Scope="Request">{bfce21b9-ffc9-4815-ad9c-
    3e92e06876bc}</SetList>
  <SetVar Name="View">{e5367bf3-43e9-45d6-bf9b-c2d120af9c86}</SetVar>
  <SetVar Name="ShouldDisplayID">TRUE</SetVar>
  <SetVar Name="ShouldDisplayTitle">TRUE</SetVar>
  <SetVar Name="ShouldDisplayExpires">TRUE</SetVar>
  <SetVar Name="ShouldDisplayLinkTitle">TRUE</SetVar>
  <SetVar Name="ShouldDisplayEditor">TRUE</SetVar>
  <SetVar Name="ViewOrder0">1_ID</SetVar>
  <SetVar Name="ViewOrder1">2_Title</SetVar>
  <SetVar Name="ViewOrder2">3_Expires</SetVar>
  <SetVar Name="ViewOrder3">4_LinkTitle</SetVar>
  <SetVar Name="ViewOrder4">5_Editor</SetVar>
  <SetVar Name="SortField1">tp_Title</SetVar>
  <SetVar Name="SortAscending1">FALSE</SetVar>
  <SetVar Name="IsThereAQuery">TRUE</SetVar>
  <SetVar Name="FieldPicker1">ID</SetVar>
  <SetVar Name="OperatorPicker1">Gt</SetVar>
  <SetVar Name="CompareWithValue1">4</SetVar>
  <SetVar Name="NextIsAnd1">FALSE</SetVar>
  <SetVar Name="FieldPicker2">ID</SetVar>
  <SetVar Name="OperatorPicker2">Lt</SetVar>
  <SetVar Name="CompareWithValue2">10</SetVar>
  <SetVar Name="NextIsAnd2">FALSE</SetVar>
  <SetVar Name="TotalID">COUNT</SetVar>
  <SetVar Name="ViewStyle">0</SetVar>
  <SetVar Name="RowLimit">100</SetVar>
  <SetVar Name="Paged">TRUE</SetVar>
</Method>
Show: