Getting workitem informaton through query
I have a scenario in which I want to show the following columns defined in the query but when I bind the workitems collection to the grid it is getting some columns defined in the query and some are missing, also I am seeing some extra columns which i have not define in the query.
const string wiqlQuery = @"SELECT [System.Id],
[System.Title],
[System.AssignedTo],
[Microsoft.VSTS.Scheduling.CompletedWork],
[Microsoft.VSTS.Scheduling.RemainingWork]
FROM WorkItems
WHERE [System.WorkItemType] = 'Document'
开发者_Go百科 and [Tyler.Document.Type] = '03-Design Document'
ORDER BY [System.Title]";
var workItems = workItemStore1.Query(wiqlQuery);
dataGridView1.DataSource = workItems;
If the fields are custom fields, you are going to have to get them explicitly and bind them explicitly. Only the standard "system" fields are exposed as properties. The rest you have to get through an array.
When your grid has 'autofinding' columns, it could be possible that the returned result shows only the fields that have data.
精彩评论