SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to know if a content type is hidden (Visible not checked in Change new button order and default content type section) on a SharePoint list using SharePoint web services. I have tried the GetListContentTypes() and GetListContentType() methods in the Lists.asmx web service but the result does not include the Hidden attribute.

How can i find if a content type is hidden using SharePoint web services without using the SharePoint API? Do I need to create a custom web service?

share|improve this question
up vote 1 down vote accepted

Are you working with SharePoint 2007 or 2010? In 2010 you can use the new Client Object Model to get this information. When you do changes in the Change new button order and default content type you can see this information in the List.RootFolder.ContentTypeOrder collection. This collection only contains the visible ContentTypes, so you need to check it against all the ContentTypes on the list to find the hidden ones. See example for getting the ContentTypeOrder collection:

Add Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll as references to your project and try this code:

using (Microsoft.SharePoint.Client.ClientContext ctx = new Microsoft.SharePoint.Client.ClientContext("http://servername/"))
    var web = ctx.Web;
    var query = ctx.LoadQuery(web.Lists.Where(p => p.Title == "Documents"));

    List list = query.FirstOrDefault();
    ctx.Load(list.RootFolder, folder => folder.ContentTypeOrder);

    foreach (ContentTypeId contentTypeId in list.RootFolder.ContentTypeOrder)
share|improve this answer
I have tried the SharePoint client object model on the list level and got the content types. But the problem is that the "Hidden" attribute of all content types is false even if I unchecked them in the “Change new button order and default content type” section. Do you have any idea? – user3470 Jan 9 '12 at 7:38
It seems that it can’t be done using the SharePoint web services. I can create my own web service or use the SharePoint client object model as you described. – user3470 Jul 10 '12 at 6:38

Can you try using Webs.asmx and use the Method GetContentTypes. The response xml would be as below

<ContentType Name="System" ID="0x" Description="" Group="_Hidden" NewDocumentControl="" Scope="http://metechmeydhango:5000" Version="0" RequireClientRenderingOnNew="TRUE" xmlns="" > 

From above response xml you can find the Group as Hidden

share|improve this answer
The “Group” attribute in this xml defines the group that the content type belongs to on the site level. If I created a custom content type and added it to the “Custom content types” group, the “Group” attribute will be equal to “Custom content types”. So I can’t know if the content type is hidden on a specified list and visible on the other. – user3470 Jan 9 '12 at 7:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.