Partilhar via


Column Element (View)

Applies to: SharePoint Foundation 2010

Returns the raw data value for a particular field, as opposed to the formatted version provided by the Field element. In the case of a Lookup field, Column returns the local value (an ID number in the list that references another list), while the LookupColumn element returns the data from the foreign table.

<Column
  AutoHyperLink = "TRUE" | "FALSE"
  AutoHyperLinkNoEncoding = "TRUE" | "FALSE"
  AutoNewLine = "TRUE" | "FALSE"
    Default = "Text"
  Format="DateTime"
    HTMLEncode = "TRUE" | "FALSE"
    Name = "Text"
    ShowField = "Text" 
    StripWS = "TRUE" | "FALSE"
  SubColumnNumber = Integer
    URLEncode = "TRUE" | "FALSE"
    URLEncodeAsURL = "TRUE" | "FALSE">
</Column>

Attributes

Attribute

Description

AutoHyperLink

Optional Boolean. TRUE to surround text with <A> tags if the text appears like a hyperlink (for example, www.microsoft.com).

AutoHyperLinkNoEncoding

Optional Boolean. TRUE to surround text with <A> tags if the text appears like a hyperlink (for example, www.microsoft.com) but without HTML encoding.

AutoNewLine

Optional Boolean. TRUE to insert <BR> tags into the text stream and to replace multiple spaces with a nonbreaking space (&nbsp;).

Default

Optional Text. Renders the text assigned to this attribute if the value returned by a selection is an empty string ("").

Format

Optional Text. Controls the date formatting for date fields. Supported formats include DateTime, DateOnly, TimeOnly, ISO8601, ISO8601Basic, and ISO8601Gregorian.

HTMLEncode

Optional Boolean. TRUE to convert embedded characters so that they are displayed as text in the browser. In other words, characters that could be confused with HTML tags are converted to entities.

Name

Optional Text. Allows the Column element to be used outside the field rendering context by supplying an ID (for example, <Column Name="ID"/>).

ShowField

Optional Text. The ShowField attribute can be set to the column name to display. By default, a hyperlinked text from the Title column of the record in the external list is displayed. But the ShowField attribute can be used to override that and display another field from the external list.

The following data types are allowed as targets of a ShowField attribute: Text, Choice, and Counter.

StripWS

Optional Boolean. TRUE to remove white space from the beginning and end of the value returned by the element.

SubColumnNumber

Optional Integer.

URLEncode

Optional Boolean. TRUE to convert special characters, such as spaces, to quoted UTF-8 format (for example, %c3%ab for character ë).

URLEncodeAsURL

Optional Boolean. Like URLEncode, but TRUE to specify that the string to encode is a path component of a URL so that forward slashes ("/") are not encoded.

Child Elements

None

Parent Elements

Numerous

Occurrences

Minimum: 0

Maximum: Unbounded (1 within Limit)

Remarks

Note that when an empty Column element (<Column/>) is used, it is sensitive to the current setting of the DisplayMode variable. The display mode is set implicitly according to the current command being used. If a view or item is being displayed, DisplayMode is set to Display. If an item is being created from a form, DisplayMode is set to New. If an existing item is being edited, DisplayMode is set to Edit. The DisplayMode variable can be overridden in the page by setting it directly, for example, <SetVar Name="DisplayMode">Edit</SetVar>.

Using <Column/> to render a date field or a number field will render the data in the locale of the server because <Column/> renders numeric values according to the locale-specific rules of the server.

See Also

Reference

Column2 Element (View)

Field Element (View)

LookupColumn Element (View)