0

Whenever I am trying to rename the title field in Sharepoint list, instead of renaming the field it creates another field with display name Title and Internal name as Title1. Here is my code:

SPList splist = spWeb.Lists["listName"];
spWeb.AllowUnsafeUpdates = true;
var field = splist.Fields[SPBuiltInFieldId.Title];
field.Title = "Last Name";
field.Update();
spWeb.AllowUnsafeUpdates = false;
1

1 Answer 1

1

For SP2010/07, the internal name of Title cannot be modified, yet you can change displayname for Title.

use field.DisplayName = "Last Name"

Here, the internal name is Title and display name is "Last Name".

2
  • DisplayName property does not exists. To change the display name field.Title is used
    – DRS
    May 21, 2015 at 5:59
  • Since field is of type var, DisplayName cannot exists, it should be SPlistitem
    – Shiva
    May 21, 2015 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.