I'm trying to rename an enterprise keywords column in a specific list of a subsite. In a Feature Activated event receiver i tried to set the column's display name by setting its title using the following method:

SPField field = list.Fields["Enterprise Keywords"]; 

when debugging everything seems to be ok, the new name appears but when i navigate to the list, the Enterprise Keywords column is the same.

I tried using the reflection method, as suggested in a post i read, but this fails as well.

private static void SetFieldDisplayName(SPFieldLookup continuingProjectLookup, string displayName)
    Type baseType = continuingProjectLookup.GetType().BaseType;
    object obj = baseType.InvokeMember("SetFieldAttributeValue", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance,    null, continuingProjectLookup, new object[] { "DisplayName", displayName });

Although in debugging it seems ok, in the UI it doesnt change.

The only possible way i found to have this column renamed is if i change the site collection's Enterprise Keywords column name, but then it also changes the name to all the other lists, which i don't want to happen.

Is there no better way?


1 Answer 1


It is recommended to reference the field by it Internal Name or ID

In your code there is no any guarantee that you are really modifying title for Enterprise Keyword field, because Display Name is used for reference

So, below is updated code to change Enterprise Keyword field title:

//Rename title for Enterprise Keyword field in List
 public static void RenameEntKeywordInList(SPList list, string newTitle)
     var field = list.Fields.GetFieldByInternalName("TaxKeyword");
     field.Title = newTitle;

There is known issue related with updating field title when the language of current Thread UI is different from language of the web

In that case use the following method:

private static void SetFieldDisplayName(SPField field, string displayName)
   var baseType = field.GetType().BaseType;
   if (baseType != null)
       baseType.InvokeMember("SetFieldAttributeValue", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance, null, field, new object[] { "DisplayName", displayName });


var field = list.Fields.GetFieldByInternalName("TaxKeyword");
SetFieldDisplayName(field, "New Enterprise Keyword Name");
  • Hey Vadim, Thanks for answering, but this method still produce the same result. When i debug everything seems to be great, once i navigate to the list - field name stays the same... :( May 3, 2013 at 14:24
  • Hey @JohnnyT, could you please try to call Update method for field like this: field.Update(true); // propagate changes to lists that implement the field May 3, 2013 at 14:33
  • same reaction :( if i try to change any other field in that list, it works flawlessly.. only the Enterprise Keywords field refuses to change. May 3, 2013 at 15:30

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.