Share via


Hidden attributes to control your work item form layout

Did you ever want to add two text fields on a tab vertically and wondered how to control their heights? Ever wanted to add same field twice in different places on a work item form? These are possible, but that configuration detail got missed in our documentation for control’s attributes at: https://msdn2.microsoft.com/en-us/library/aa337625(VS.80).aspx . Below is control element options given in documentation:

 

<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.

Comments

  • Anonymous
    April 04, 2007
    A while back I made a post on Hidden attributes to control your work item form layout . Later I realized

  • Anonymous
    July 07, 2007
    Naren [1] reveales a few very interesting on hidden attributes his blog [2] which you definetly should

  • Anonymous
    July 30, 2007
    Paul Hacker wrote about a WorkItem date picker control: I have just made available a workitem control

  • Anonymous
    January 21, 2008
    Does MasLength attribute also apply to HTMLFieldControl  ?