Naren's Blog

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: http://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.

 

 

Published Friday, February 09, 2007 1:24 AM by narend

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Naren's Blog said:

A while back I made a post on Hidden attributes to control your work item form layout . Later I realized

April 4, 2007 2:06 PM
 

Visual Studio Team System (VSTS) Blog said:

Naren [1] reveales a few very interesting on hidden attributes his blog [2] which you definetly should

July 7, 2007 10:42 AM
 

Stuart Preston's Blog said:

Paul Hacker wrote about a WorkItem date picker control: I have just made available a workitem control

July 31, 2007 4:10 AM
 

Glenn said:

Does MasLength attribute also apply to HTMLFieldControl  ?

January 22, 2008 7:01 AM

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker