I have a Custom Document Set Content Type “Application Document Set”
In the edit mode at the very first row there is a field called “Content Type”, it is dropdown list and it is built in field. In my case I want to Hide it. I have tried programmatic and declarative way, both of them are not working. It is still showing in Edit Form.
Declarative:
<FieldRef ID=" c042a256-787d-4a6f-8a8a-cf6ab767f12d " Name="ContentType" DisplayName="Content Type" Hidden="TRUE" ShowInEditForm="FALSE"/>
Programmatic:
SPList list = web.Lists["Applications"];
SPContentType contentType = list.ContentTypes["Application Document Set"];
//SPFieldLink link = contentType.FieldLinks[SPBuiltInFieldId.ContentType];
SPField field = contentType.Fields[SPBuiltInFieldId.ContentType];
field.Hidden = true;
field.ShowInEditForm = false;
contentType.Update();
list.Update();
web.Update();
Any idea? Thanks