TFS & Visual Studio ALM – by Neno Loje

(formerly Team System, VSTS)

Undocumented attributes for controlling the Work Item form layout

July 7th, 2007 · No Comments · Team Foundation Server, TFS 2005, TFS Process Customization, TFS Tips and Tricks, TFS Work Item Tracking, Work Item Customization

Naren [1] revealed a few very interesting on hidden attributes his blog [2] which you definitely should take a look at since they let you solve some problems as the following ones:

Control the height of two text boxes that were placed vertically on one tab

When placing more than one text box on a tab page you will notice that all text boxes have the same height except the last one which can be annoying if you use HTML and expect the writer to write a lot.


Using the “MinimumSize” attribute in the Work Item Type XML you can specify the minimum width and height that the control has to have.


Resulting in a much more nice looking writing experience:


Show the same field twice in different places

Sometimes it makes sense to place the same field on two places for example in the general area as well as on a tab. If you do so you would get an error.


You can use “Name” attributes with different values to allow the field to be displayed multiple times.


This leads to the desired effect. Note that if you enter something in the one field it will automatically appear in the other text field after leaving the control.


So here’s the background by Naren. A must read for people customizing Work Item types:

<Control FieldName=”control name” Type=”FieldControl | DateTimeControl | HtmlFieldControl | LinksControl | AttachmentsControl | WorkItemClassificationControl | WorkItemLogControl” Label=”label text” LabelPosition=”Top | Bottom | Left | Right” Dock=”Fill | Top | Bottom | Left | Right” Padding=”(left, top, right, bottom)” Margin=”(left, top, right, bottom)” ReadOnly=”True | False” />


Attributes that weren’t documented:


MinimumSize: The minimum size the control should occupy in the form. If vertical space is not enough, then a scrollbar is shown to keep its minimum size. Without this attribute, the controls are drawn with their default sizes (unless controls in other tabs take larger space that incrasing whole tab’s size). The syntax for it’s value is “(width,height)” (In regex format it is “^\(\d+\,\d+\)$”).


Name: If you want to add same field to be displayed in more than one place, it is possible but the Name attribute should be set to unique values for both – so that the system identifies each control uniquely. It is useful to show same control in various places based on context of tabs.


[Update: 3/12/07]

Below are special attributes available for specific controls:

NumberFormat (for FieldControl only): Useful if a number value is displayed in the field. Possible values: WholeNumbers, SignedWholeNumbers, DecimalNumbers, SignedDecimalNumbers. Setting this attribute determines what characters are allowed to be entered in this control.


MaxLength (for FieldControl only): Maximum length of allowed characters for field control in form UI.


Format (for DateTimeControl only): One of values of DateTimePickerFormat enum. Possible values as given in help are: Long, Short, Time and Custom. Custom format can be set by having ‘Custom’ as value for this attribute, and setting another attribute named CustomFormat with actual custom format string.





No Comments so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment