SharePoint: Visual Studio 2012 List Designer Oddity with Default Content Types


The new SharePoint designers in Visual Studio 2012 are a great productivity booster, and it’s now much easier to create Site Columns, Content Types and List Definitions.

Today I came across some peculiar behaviour in the List [definition] designer when it came to configuring the lists Content Types.

I’d added a custom content type to the list and wanted to remove the default Item and Folder content types, but right clicking these content types in the designer showed a disabled “Delete” option;

List Designer

If you edit the list definition schema.xml file, you can manually remove those ContentType references, and then re-entering the designer shows correctly.

<List xmlns:ows="Microsoft SharePoint" Title="Organisation Leaders" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Organisation Leaders" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/" EnableContentTypes="TRUE">
  <MetaData>
    <ContentTypes>
      <ContentType ID="0x0100C26D5A3749D6453F9CCC4E5A72419A57" Name="Organisation User" Group="Platinumdogs Custom Content Types" Description="A content type representing an organisation user." Inherits="TRUE" Version="0">
        <FieldRefs>
          <FieldRef ID="{9A377E88-F39C-445E-B09C-BD91AE5B3766}" DisplayName="Organisation User" Required="TRUE" Name="pdogOrganisationUser" />
        </FieldRefs>
      </ContentType>
    </ContentTypes>
    ...
  </MetaData>
</List>

However, spending a few minutes scratching my head, I notice the little triangle next to a content type in the list designer;

The Magic McGafter

Clicking this little McGafter, enables these default ContentTypes, allowing you to remove them using the designer, just right-click and choose Delete.

Remove the ContentType

Published by

Phil Harding

SharePoint Consultant, Developer, Father, Husband and Climber.

2 thoughts on “SharePoint: Visual Studio 2012 List Designer Oddity with Default Content Types

  1. Along with new designers it also facilitate new templates with some new options to which one can easily deploy as well as test sharePoint sites. As far as I know content types are critical component through which inheritance is carried out through its id.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s