MultiValue Control

A ComboBox Control to accept and show multiple values for a field by showing a list of checkboxes.

multivaluecontrol.jpg

Installation
In order to use this control, at two files must be present in the deployment folder:

MultiValueControl.wicc
CodePlex.WitCustomControls.dll

The deployment folder is located at the following location under a default client install: <ApplicationData>\Microsoft\Team Foundation\Work Item Tracking\Custom Controls.

Schema
Fields associated with multivalue control should have list of suggested values and each value enclosed in square brackets. For example:

<FIELD name="Triage" refname="Microsoft.VSTS.Common.Triage" type="String" reportable="dimension">
<HELPTEXT>Status of triaging the bug</HELPTEXT>
<SUGGESTEDVALUES expanditems="false">
<LISTITEM value="[Approved]" />
<LISTITEM value="[Investigate]" />
<LISTITEM value="[Rejected]" />
<LISTITEM value="[Submit]" />
</SUGGESTEDVALUES>
</FIELD>

Then use MultiValueControl as controltype for that field in Form section, for example:

<Control Type="MultiValueControl" FieldName="Microsoft.VSTS.Common.Triage" Label="Triag&amp;e:" LabelPosition="Left" />


Quering
For quering work item based on MultiValueControl field, the control value is treated as a string. To search for items that has a specific list item selected in the MultiValueContorl use the contains operator and don't forget the square bracket when you enter the value. If you are searching for a specific list item selected and only that item is selected use the = operator. If sreaching for item that has more than one list item selected use multipe 'contains' clauses for that field.
Last edited Apr 20 2009 at 8:23 PM by hayderc, version 4
Comments
mcdubjr Sep 25 2007 at 6:22 PM 
I had two problems getting this to work. The first problem I had was that I copied the control tag from the example above, but the web brower converts the ampersand tag for the Label attribute.

//correctly formated tag (hopefully I'm using wiki markup correctly)
{{ <Control Type="MultiValueControl" FieldName="Microsoft.VSTS.Common.Triage" Label="Triag&amp;e:" LabelPosition="Left" /> }}

Once I fixed that I was able to import the WIC file but ran into another issue. I revieved this error message when created a new work item:

add_AfterUpdateDatasource' in type 'CodePlex.WitCustomControls.MultiValueCustomControl.MultiValueControl' from assembly 'CodePlex.WitCustomControls, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null' does not have an implementation.

To fix this I modified the MultiValueControl.cs file.
//add this code
{{
event EventHandler IWorkItemControl.AfterUpdateDatasource
{
add { DataSourceEvents.AddHandler(EventBeforeUpdateDatasource, value); }
remove { DataSourceEvents.RemoveHandler(EventBeforeUpdateDatasource, value); }
}

}}

Jim

hayderc Sep 28 2007 at 2:36 AM 
Thanks Jim, I have update the code and binaries.

-Hayder

tangrl Oct 1 2007 at 9:16 PM 
I tried to add a MultiValueControl to a Work Item Type. When I tried to import it with witimport utility, it gave the following error:
Xml validation error at row 350, column 62: The 'Type' attribute is invalid - The value 'MultiValueControl' is invalid according to its datatype 'ValidControlsType' - The Enumeration constraint failed.

I have SP1 installed on the server and Visual Stuio Team Edition SP1 installed at the Client. I made sure MultiValueControl.wicc and CodePlex.WitCustomControls.dll files are in "AllUsers\<ApplicationData>\Microsoft\Team Foundation\Work Item Tracking\Custom Controls" folder.

Thanks!

Richard.

hayderc Oct 3 2007 at 1:46 AM 
Richard, I've seen this issue before. Take a look at this forum discussion: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=801890&SiteID=1

mrzenka Dec 17 2008 at 4:29 AM 
Is there a way to tie this control to Team System Web Access?

jonlu Jan 16 2009 at 3:27 PM 
Hi!
I tried the control and it works nicely but of course it doesn't work on the web client. Have you got any plans to implement web funcitonality or do you know of a version that works on the web client?

Thanks!

Jon

Jethro Apr 2 2009 at 8:05 AM 
hi, how can i change the "System.AssignedTo" to multi-value , I want only users who are contributors or project administrator of the project will be listed.
<FIELD name="Assigned To" refname="System.AssignedTo" type="String">
<ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
<LISTITEM value="[Project]\Contributors" />
<LISTITEM value="[Project]\Project Administrators" />
</ALLOWEDVALUES>
<PROHIBITEDVALUES expanditems="true">
<LISTITEM value="tfsservice" />
</PROHIBITEDVALUES>
<ALLOWEXISTINGVALUE />
</FIELD>

Updating...
© 2006-2010 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2010.1.12.16187