I have my own list, which can contain CustomContentType. This is how I create a new item:
//Create root folder SPListItem rootItem = navigation.Items.Add(); SPContentType folderType = navigation.ContentTypes["ListLevel"]; rootItem[SPBuiltInFieldId.Title] = "root"; rootItem["ContentTypeId"] = folderType.Id; rootItem.Update();
The problem is that when I look at my list, I see the following:

When I go to the list through a web browser and create the content type manually, everything is fine. (This means that the header is "root", not an ID).
source share