In the old days (last year), if you were a front-end ASP.NET developer and you needed to present a drop-down list with sorted items, you would check the data that the person that wrote the business layer method and if it came to you unsorted, you would first curse that person, and then either mess with the code so that the data comes back sorted, sneak around to the database and add an “ORDER BY” clause to that query, or add sorting to your drop-down list.
Thanks to LINQ’s extended methods, now you just call the OrderBy method of the IEnumerable type that you get back and you are all set:
foreach (MyType _Item in GetItemsForDropDown().OrderBy(p => p.Name)) { ddlSortedList.Items.Add(new ListItem(_Item.Name, _Item.ID)); }
Where GetItemsForDropDown() would return an IEnumerable
It’s jut a little thing, but it’s just amazing how something so simple can make you love the technology that much more!
Mark Allen
Another approach which works well is to have the XML tag reference a custom TFS group. In my case there is a master contributor group shared between projects so rather than list all the contributor users in the template AssignedTo list boxes I created a TFS group called ‘TeamAssignments’ and within security I referenced the team. Then in the templates I added the tag ListItem value=[project]\TeamAssignments. Now when anyone is added to the team they are displayed in the AssignedTo List box. This also means that another team can be created without changing the templates as the changes can be done in security.
TFS Team Name: Blue (example set up in security)
TFS Group Name: TeamAssignments
Members: Team Blue