3
votes

I add columns to a content type via code. This works quite well (checking this at "site settings - content types - (my content type))

Now I expected that in the document library which has that content type as its parent these columns are also included automaticly. But that did not happen. Some older columns of that content type are included, but the columns I just added to the content type are not available.

Any idea, what I have to do to add those columns to the document library?

2

2 Answers

1
votes

Does the content type element for the document library has Inherit attribute set to TRUE.

Schema Ref: http://msdn.microsoft.com/en-us/library/aa544268.aspx

1
votes

Ok. I was confused by the naming inside Sharepoint. In the Web-Backend SITE content types are called "content types". LIST content types (eg. from pages) are called "document library". So to achieve what I wanted I had to add an SPLookupField to the Site Content Type and another Lookup to that sites content type column into the list content type.