How do you set "Allow management of content types?" to "Yes" within a Content Type or List Definition?
This can be done either by setting
EnableContentType=true in the list definition or in the feature activation event we can set the attribute. Please refer the below links. They will definitely help you in solving your problem.
This says to "toggle the SPList ContentTypesEnabled property from False to True".
Just toggle the SPList ContentTypesEnabled property from False to True. That enables the use of multiple content types on the list.
The way I do it is I set the ListCreationInfo and then create the list and enable ContentTypes:
ListCreationInformation creationInfo = new ListCreationInformation();
creationInfo.Title = ListManager.ListTitle;
creationInfo.TemplateType = (int)ListtemplateType.Annoucements;
List list = web.Lists.Add(creationInfo);
list.Description = ListManager.ListDescription;
list.ContentTypesEnabled = true;
This is an old thread but may benefit from the PnP Powershell commands available now:
#Config Variables $SiteURL = "https://<tenantName>.sharepoint.com" $ListName = "<ListName>" #Connect to PNP Online Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) #Enable Content Type Set-PnPList -Identity $ListName -EnableContentTypes $True