Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
    
Does your list have more then one content type attached ? If so, you get the drop down list. –  Oddmar Dam Nov 26 '12 at 10:12
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.