Creating custom content type using an object model
In the previous recipe, we extended a content type using an XML schema. This can get pretty difficult as Visual Studio does not provide ways to debug the XML schemas. Instead of using the xml schema method, you can always use object model APIs to create the content type. In this recipe we will do just that.
For this recipe, we will create a new content type called Project Proposal that has four custom columns Amount, Department, Project Start Date, and Project End Date. The Department
field is a choice type where you can select the department to which the project belongs. The Amount
field is of currency type and the Project Start Date
and the Project End Date
are of DateTime
type. The content type ...
Get Microsoft SharePoint 2010 Development with Visual Studio 2010: Expert Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.