Check Box Control

This is a simple control that allows you to use a checkbox where you would normally see a drop down list box containing two items - basically it makes the UI look more intuitive and saves you a mouse click :-)

Check Box Control

This example shows binding the check box control to the Issue field in a bug in the MSF agile template, but you aren't restricted to just that field - any 2 values field will do.

To get the button to display for the Issue field, you will need to modify the work item definition as follows:

    <Control Type="WorkItemCheckBox" 
             FieldName="Microsoft.VSTS.Common.Issue" 
             Label="Iss&amp;ue:" 
             LabelPosition="Left" 
             Checked="Yes" 
             Unchecked="No" 
             Text="(Include in issue list)"/>


You will then need to import the work item definition file into your project, for more information and some handy hints about this, please see Uploading WIT definitions.

The Checked and Unchecked attributes define what value will be entered into the bound field. The Text field allows you to put some text to the right of the check box.
In the MSF template, the Issue field is defined as having two possible values; "Yes" and "No"

    <FIELD name="Issue" refname="Microsoft.VSTS.Common.Issue" type="String" reportable="dimension">
        <HELPTEXT>Used to highlight the bug, e.g., to mark it as an issue.</HELPTEXT>
        <REQUIRED/>
            <ALLOWEDVALUES>
                <LISTITEM value="Yes"/>
                <LISTITEM value="No"/>
            </ALLOWEDVALUES>
        <DEFAULT from="value" value="No"/>
    </FIELD>


If the filed you bind the checkbox to has allowed values, it will validate that the Check & Unchecked attributes match these allowed values.

Last edited Jul 25, 2007 at 2:21 PM by NeilKidd, version 5

Comments

No comments yet.