Corey Roth and Friends Blogs

Group site for developer blogs dealing with (usually) Ionic, .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.

Kyle Kelin on .Net

Creating a List from a List Template

I recently struggled with this code and thought I would document it here.

SPListTemplateCollection listtempColl = web.ListTemplates;

                       SPListTemplate myListTemplate = listtempColl["Random List Template"];
                       web.Lists.Add("MyList", "my list description", myListTemplate );


Pretty simple code. I use the ListTemplate collection of the SPWeb to get a template I have already deployed. I then use that template in the Add method to create the list instead of one of the built in templates.


No Comments

Leave a Comment


About KyleKelin

Kyle Kelin has been implementing software in the Microsoft space for the past 6 years mainly as a consultant. His interests are SharePoint, .NET, JQuery, and Silverlight.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems