Renaming column names in Query  
Author Message
Robert Kozak





PostPosted: Team Foundation Server - Work Item Tracking, Renaming column names in Query Top

Is there a way to rename a column name in a query

I have a different Priority field in our WorkItem type called DashPriority but as far as the User is concerned it is Priority. When I add Dash priority to the a Work Item Query it displays "DashPriority" as a column header.

I am sure most people want to rename these column headers but I can't seem to find where to change them.




Visual Studio Team System4  
 
 
Naren Datha - MSFT





PostPosted: Team Foundation Server - Work Item Tracking, Renaming column names in Query Top

I do not think there is a way. I did a quick look into code but I do not see any apparant way to enable users to specify different friendly name in query result headers. We have reference name & friendly name for this purpose. Just curious, supposing we provide such feature, where (in UI or otherwise) do you think is best place for your to configure such names



 
 
Gary Lam





PostPosted: Team Foundation Server - Work Item Tracking, Renaming column names in Query Top

do you mean in SQL
forexample you have table
table1
colA
colB
colC
create a view that resturn

Select
colA as ColumA,
colB as ColumB,
colC as ColumC
From table1


then when you query your view you header will change to ColumA ColumB ColumC
.

If you doing it in your DataGrid you may need to modify your ColumnStyle to change the header


 
 
Robert Kozak





PostPosted: Team Foundation Server - Work Item Tracking, Renaming column names in Query Top

How about in your query builder. You specify column order and sort order. Most apps just add a Rename button in that dialog.

Another method we use in our application is allowing the user to in place edit column names by right clicking on the column header and selecting rename.



 
 
Robert Kozak





PostPosted: Team Foundation Server - Work Item Tracking, Renaming column names in Query Top

Yeah I know how to do that easily enough using SQL but I am thinking of the Queries node in Team Explorer. Doesn't look like I can do this in WIQL.