This question was posted in MSDN forum. How to rename Type column in a perticular List. In GUI, there is no option to rename the column. However, we can achieve this programmatically. Let's see the code:
Now, refresh your List view! You can see the column name as "MyType"!
Here, in the perticular site and the list, get hold of "Type" field. Change the Title to whatever you want and call Update method.
using (SPSite mySite = new SPSite("http://server/mySite/"))
{
using (SPWeb myWeb = mySite.OpenWeb())
{
SPList myList = myWeb.Lists["ListName"];
SPField myField = myList.Fields["Type"];
myField.Title = "MyType";
myField.Update();
}
}
Now, refresh your List view! You can see the column name as "MyType"!
Comments
Post a Comment