ViewStyle element (List)
Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013
Contains the definition of a view style for a list.
<ViewStyle
BaseType = "Integer" | "Text"
Description = "Text"
DisplayName = "Text"
ID = "Counter"
Preview = "Text"
Type = "Integer">
</ViewStyle>
Elements and attributes
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute | Description |
---|---|
BaseType |
Optional. Specifies the base type of the list. The BaseType attribute can be set to Integer, which stores values as integers, or to Text (default), which stores values as text. |
Description |
Optional Text. Contains a description for the view style. |
DisplayName |
Required Text. Specifies the display name of the view style. |
ID |
Required Counter. Specifies the ID that uniquely identifies the view style. |
Preview |
Optional Text. Specifies the site-relative path to a preview image for the view style. For example, _layouts/images/prvpicl.gif . |
Type |
Optional Integer. Specifies the list definition type. |
Child elements
- GroupByFooter
- GroupByHeader
- PagedClientCallbackRowset
- PagedRecurrenceRowset
- PagedRowset
- Script
- ViewBidiHeader
- ViewBody
- ViewEmpty
- ViewFields
- ViewFooter
- ViewHeader
Parent elements
Occurrences
- Minimum: 0
- Maximum: 1 (Unbounded within ViewStyles)
Example
The following example outlines the sections contained within the Boxed view style of a ViewStyles.xml file.
<ViewStyle ID="13" DisplayName="Boxed" BaseType="0">
<ViewFields />
<GroupByHeader>
...
</GroupByHeader>
<GroupByFooter>
...
</GroupByFooter>
<ViewHeader ExpandXML="TRUE">
...
</ViewHeader>
<ViewBidiHeader ExpandXML="TRUE">
...
</ViewBidiHeader>
<ViewBody ExpandXML="TRUE">
...
</ViewBody>
<ViewFooter ExpandXML="TRUE">
...
</ViewFooter>
<PagedRowset>
...
</PagedRowset>
<PagedRecurrenceRowset>
...
</PagedRecurrenceRowset>
<RowLimit Paged="TRUE">100</RowLimit>
<ViewEmpty>
...
</ViewEmpty>
...
</ViewStyle>