sharepoint list change field display name

SPField f = list.Fields.GetFieldByInternalName("myOldStaticName");
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(f.SchemaXml);
xdoc.ChildNodes[0].Attributes["DisplayName"].Value = "myNewName";
f.SchemaXml = xdoc.OuterXml;
f.PushChangesToLists = true;      // *** push to list
f.Update(true);                   // *** using Update(true) updates list & DB

Добавить комментарий

Loading