Get the base list types available in SharePoint

If you want retrieve the list of base list types available in SharePoint ,please use the below code

string[] listTypeNames = System.Enum.GetNames(typeof(SPListTemplateType));
Array listTypeValues = System.Enum.GetValues(typeof(SPListTemplateType));

int j = 0;

foreach (int i in listTypeValues)
{
Console.WriteLine(listTypeNames[j++].ToString() + ” ” + i.ToString());
}

This should return the results like below
SPListTemplateType.Contacts = 105
SPListTemplateType.DiscussionBoard = 108
SPListTemplateType.DocumentLibrary = 101
SPListTemplateType.Events = 106
SPListTemplateType.Announcements = 104
SPListTemplateType.GenericList = 100
SPListTemplateType.InvalidType = -1
SPListTemplateType.IssueTracking = 1100
SPListTemplateType.Links = 103
SPListTemplateType.ListTemplateCatalog = 114
SPListTemplateType.PictureLibrary = 109
SPListTemplateType.Survey = 102
SPListTemplateType.Tasks = 107
SPListTemplateType.WebPartCatalog = 113
SPListTemplateType.WebTemplateCatalog = 111
SPListTemplateType.XMLForm = 115

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

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