Wednesday 9 October 2013

TFS - Adding HTMLFeildControl to Work Item

There are two important points to consider if you are adding HTMLFeildControl to a work item.

1. First You need to have the correct type for the field that you are adding. HTML is the type that works for HTMLFeildControl.

To illustrate I have added three fields, two having type HTML and one having plain text. See the behaviour of the "PlainText" type field on a HTMLFieldControl. It does not give the HTML field control editiong options and notifies an error with color.

2. Use MinimumSize attribute

Tip from MSDN 

"When you add several HTMLFieldControl elements on a form that will be stacked vertically, you should specify the MinimumSize attribute for each field control. In this manner, you can make the text boxes all a similar size. Otherwise, the last HTML control element is sized to fill the form, and the previous elements appear together with smaller text boxes."

For more information refer Control the Display of Work Item Fields: Adding Formatted Text Fields

No comments:

Popular Posts