Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, April 27, 2010 12:12 PM
Hello,
In SharePoint 2010 it is possible to add additional columns of the source list when adding a lookup column.
E.g. I can add a lookup column to the Title column in the Projects list, and I can name this column "Project".
When adding this title column, I can also check the column Status from the Projects list to be displayed as additional column for this lookup field, so I can see the status of the referenced project as well.
This status column will be added in the list views as "Projects:Status". Is it possible to rename this to e.g. "Status of Project" ?
So the same way I can indicate that the lookup column (which uses the title column) should be named "Project" and not Title or Projects:Title or anything.
Thanks in advance!
All replies (6)
Tuesday, May 4, 2010 11:08 AM ✅Answered
For anyone else facing this problem:
I just learned that the RTM version does provide the possibility to rename these extra columns, just as any other column.
When you go to the list settings and check the list of columns, the extra column will be listed there as well and you can click on the column and rename it.
So no need for a custom tool/code after all :)
Tuesday, May 4, 2010 3:08 PM ✅Answered
Dear Kurtvd,
Your solution will not work for lookup column created from external list.
“Using code” is still complete answer to your question.
MCPD (PRO: Designing and Developing Web-based Applications by Using the Microsoft® .NET Framework 2.0) MCTS (MOSS 2007 - Application Development)
Tuesday, April 27, 2010 2:42 PM
You should be able to do that in code. Get "Projects:Status" - list column and change its title property to "Status of Project".
Let me know if this works for you.
MCPD (PRO: Designing and Developing Web-based Applications by Using the Microsoft® .NET Framework 2.0) MCTS (MOSS 2007 - Application Development)
Wednesday, April 28, 2010 7:04 AM
Do you mean by using a jquery workaround on every view page, or is there a way to change it permanently (also automatically for new views in the future) through code ?
Wednesday, April 28, 2010 2:09 PM
This will change your column's display name permanently. For new views in future it will use the updated column's display name.
SPList
list = web.Lists["myList"
];
SPField status = list.Fields["Projects: Status"
];
status.Title = "Status of Project"
;
status.Update();
MCPD (PRO: Designing and Developing Web-based Applications by Using the Microsoft® .NET Framework 2.0) MCTS (MOSS 2007 - Application Development)
Thursday, April 29, 2010 10:29 AM
Thanks Aanu!
I created a small .NET tool with your code, where I can load a website, select a list, select a column and give a new name for the column :)