Editar

Compartilhar via


FormatString Element for TableColumnItem for TableControl

Specifies a format pattern that defines how the property or script value of the table is displayed.

Schema

  • Configuration Element
  • ViewDefinitions Element
  • View Element
  • TableControl Element
  • TableRowEntries Element
  • TableRowEntry Element
  • TableColumnItems Element
  • TableColumnItem Element
  • FormatString Element

Syntax

<FormatString>FormatPattern</FormatString>

Attributes and Elements

The following sections describe attributes, child elements, and the parent element of the FormatString element.

Attributes

None.

Child Elements

None.

Parent Elements

Element Description
TableColumnItem Element Defines the property or script whose value is displayed in the column of the row.

Text Value

Specify the pattern that is used to format the data. For example, this pattern can be used to format the value of any property that is of type System.Timespan: {0:MMM}{0:dd}{0:HH}:{0:mm}.

Remarks

Format strings can be used when creating table views, list views, wide views, or custom views. For more information about formatting a value displayed in a view, see Formatting Displayed Data.

For more information about the components of a table view, see Table View.

Example

The following example shows how to define a formatting string for the value of the StartTime property.

<TableColumnItem>
  <PropertyName>StartTime</PropertyName>
  <FormatString>{0:MMM} {0:DD} {0:HH}:{0:MM}</FormatString>
</TableColumnItem>

See Also

Creating a Table View

Formatting Displayed Data

TableColumnItem Element

Writing a PowerShell Formatting File