Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ListItem Element for ListItems for ListControl (Format)

 

Defines the property or script whose value is displayed in a row of the list view.

<ListItem>
  <PropertyName>PropertyToDisplay</PropertyName>
  <ScriptBlock>ScriptToExecute</ScriptBlock>
  <Label>LabelToDisplay</Label>
  <FormatString>FormatPattern</FormatString>
  <ItemSelectionCondition>...</ItemSelectionCondition>
</ListItem>

Attributes and Elements

The following sections describe the attributes, child elements, and parent element of the ListItem element. Only one property or script can be specified.

Attributes

None

Child Elements

Element

Description

FormatString Element for ListItem for ListControl (Format)

Optional element.

Specifies a format string that defines how the property or script value is displayed.

ItemSelectionCondition Element for ListItem for ListControl (Format)

Optional element.

Defines the condition that must exist for this list item to be used.

Label Element for ListItem for ListControl (Format)

Optional element

Specifies the label that is displayed to the left of the property or script value in the row.

PropertyName Element for ListItem for ListControl (Format)

Optional element.

Specifies the .NET Framework property whose value is displayed in the row.

ScriptBlock Element for ListItem for ListControl (Format)

Optional element.

Specifies the script whose value is displayed in the row.

Parent Elements

Element

Description

ListItems Element for List Control (Format)

Defines the properties and scripts whose values are displayed in the list view.

For more information about the components of a list view, see Creating a List View.

Example

This example shows the XML elements that define three rows of the list view. The first two rows display the value of a .NET Framework property, and the last row displays a value generated by a script.

<ListEntry>
    <ListItems>
      <ListItem>
        <Label>Property1: </Label>
        <PropertyName>DotNetProperty1</PropertyName>
      </ListItem>
      <ListItem>
        <PropertyName>DotNetProperty2</PropertyName>
      </ListItem>
      <ListItem>
        <ScriptBlock>$_.ProcessName + “:” $_.Id</ScriptBlock>
      </ListItem>
    </ListItems>
</ListEntry>

Show: