SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm adding here a field to the list, but it adds itself to a default content type, how can I add it to library but not to CT?

            SPFieldBoolean flagField = (SPFieldBoolean)library.Fields.CreateNewField(SPFieldType.Boolean.ToString(), "flagfield");
            flagField.DefaultValue = "0";
share|improve this question
Do you have multiple CTs in the library? – BlueBird Jun 25 '13 at 14:10
yes, it has multiple CT's and it adds to the default one, but i just want it to be added to the document library! – Shkipper Jul 10 '13 at 13:49
up vote 0 down vote accepted

I found the answer to my question! Here is the answer.

share|improve this answer

Your Answer


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

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