Sdílet prostřednictvím


Layout XML element reference

TFS 2015 | TFS 2013

Important

This article applies to project customization for the On-premises XML process model and the old work item form. For the Hosted XML process model and TFS 2017 and later versions that use the new work item form, see WebLayout and Control elements. For the Inheritance process model, see Customize a process.

For an overview of process models, see Customize your work tracking experience.

You can use the Layout element to define how the elements on the work item form appear. You can define more than one layout to support different clients, such as the Windows client for Visual Studio or the web portal layout.

To add elements to a form, you modify the definition for a work item type. See Modify or add a custom work item type.

The Layout element is a required child element of the FORM element. For more information about how to use the Layout element, see Design the work item form.

Syntax

<Layout Target="ClientName" MinimumSize="(width,height)" Padding="(left, top, right, bottom)"   
Margin="(left, top, right, bottom)" ControlSpacing="distance" LabelSpacing="distance" HideControlBorders="True | False" HideReadOnlyEmptyFields="True | False">  
       <Group> . . . </Group>  
       <Control> . . . </Control>  
       <TabGroup> . . . </TabGroup>  
       <Splitter> . . . </Splitter>  
</Layout >  

Attributes and elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
Target Optional Layout attribute.
Specifies the name of the client to which the layout applies. The type is xs:string. Specify one of the following strings:
- WinForms: Applies the form to Team Explorer and Team Explorer Everywhere.
- Web: Applies the form to the web portal.
MinimumSize Optional Layout attribute.
Specifies the minimum size in pixels for the form. The syntax is specified in (width, height). The attribute type is SizeType.
Pattern value: ^\(\d+\,\d+\)$
Pattern value example: (100,100)
Padding Optional Layout attribute.
Specifies the amount of space in pixels around the inside border of the form. The attribute type is SizeType.
Pattern value: ^\(\d+\,\d+\,\d+\,\d+\)$
Pattern value example: (2,0,2,0)
Margin Optional Layout attribute.
Specifies the amount of space in pixels around the outside border of the form. The attribute type is SizeType.
Pattern value: ^\(\d+\,\d+\,\d+\,\d+\)$
Pattern value example: (2,0,2,0)
ControlSpacing Optional Layout attribute.
Specifies the vertical offset of controls defined in the form.
LabelSpacing Optional Layout attribute.
Specifies the number of pixels between the label and the edit region of the control.
HideControlBorders Optional Layout attribute.
Specify a value of True to hide control borders, and False to display control borders.
HideReadOnlyEmptyFields Optional Layout attribute.
Specify a value of True to hide read-only and empty fields, and False to display these fields.

Child elements

Element Description
Group Optional. Defines a group of elements to display together on the form.
Control Optional. Defines a work item field, text, hyperlink, or other control element to display in a work item form.
TabGroup Optional. Contains one or more Tab elements.
Splitter Optional. Defines a splitter and its orientation on the form between sibling form elements.

Parent elements

Element Description
FORM Required. Contains the Layout element that defines how the elements on the work item type form are displayed.

Remarks

The Layout element is a required child element of FORM. The Layout element specifies a choice, and at least one of the child elements must be defined: Group, Control, TabGroup, or Splitter. You can define more than one child element.

Example

<FORM>  
   <Layout>  
      <Group>  
          <Column PercentWidth="36">  
            <Group>  
            <Control FieldName="System.Title" Type="FieldControl" Label="Title" LabelPosition="Left" />  
            <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="Area" LabelPosition="Left" />  
            <Control FieldName="Microsoft.VSTS.Common.ProductUnit" Type="FieldControl" Label="Product Unit" LabelPosition="Left" />  
            <Control FieldName="Microsoft.DevDiv.BusinessUnit" Type="FieldControl" Label="Business Unit" LabelPosition="Left" />  
            </Group>  
          </Column>  
          <Column PercentWidth="33">  
            <Group>  
            <Control FieldName="Microsoft.DevDiv.SubTitle" Type="FieldControl" Label="Sub Title" LabelPosition="Left" />  
            <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Iteration" LabelPosition="Left" />  
            <Control FieldName="Microsoft.DevDiv.Other" Type="FieldControl" Label="Other" LabelPosition="Left" />  
            </Group>  
          </Column>  
          <Column PercentWidth="31">  
            <Group>  
            <Control FieldName="Microsoft.DevDiv.Type" Type="FieldControl" Label="Type" LabelPosition="Left" />  
            <Control FieldName="System.AssignedTo" Type="FieldControl" Label="Assigned To" LabelPosition="Left" />  
            <Control FieldName="System.State" Type="FieldControl" Label="State" LabelPosition="Left" />  
            </Group>  
          </Column>  
      </Group>  
. . .  
   </Layout>  
</FORM>