Site Column project item template in Visual Studio 2012

By Vijai Anand Feb 14, 2013
In this blog you will see about the new Site Column project item template in Visual Studio 2012.

In Visual Studio 2010 we need to use Empty Element template to create the site columns whereas Visual Studio 2012 introduced a new project item template called Site Column for SharePoint 2013. By using this template it is easy for the SharePoint developers to create a site column by doing some minor changes.

Steps Involved:

1.       Open Visual Studio 2012 (Run as administrator).

2.       Go to File=> New => Project.

3.       Expand Visual C# node, then expand Office/SharePoint node in the templates panel.

4.       Select SharePoint Solution, click on SharePoint 2013 Project.

5.       Enter the Name and then click on Ok.

6.       In the Solution Explorer right click on the solution and then click on Add.

7.       Click on New Item.

8.       Select Site Column item template from the installed templates and enter the name for the site column.

9.       Click on Ok.

10.   By default the following field attributes will be available in Elements.xml if you want to update do the changes and deploy.

 

<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> 

  <Field

       ID="{0836b05c-375a-466f-977d-0ddd2659ea0b}"

       Name="SiteColumn1"

       DisplayName="Site Column 1"

       Type="Text"

       Required="FALSE"

       Group="Custom Site Columns">

  </Field>

</Elements>


11.   Site Column will be created successfully.

Vijai Anand

Vijai Anand has been working in IT industry for over 5 years. He holds Bachelor's degree in Electronics and Communication Engineering. Vijai write articles and blogs related to SharePoint 2013, SharePoint 2010, Silv... Read more

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs