Create a List Definition in SharePoint 2010

No.of Views734
Bookmarked0 times
Downloads 
Votes0
By  usamawahabkhan   On  22 Sep 2011 06:09:28
Tag : SharePoint , Enterprise Content Management
In this article, I'm going to explain how to create List of Definition in SharePoint 2010.The List Definition is brand new features in SharePoint 2010.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Inbtroduction

In this article, I'm going to explain how to create List of Definition in SharePoint 2010.The List Definition is brand new features in SharePoint 2010. 

Image Loading

Please follow the step as like below,

1. Open Visual Studio 2010 by going to Start Menu | All Programs | Microsoft Visual Studio 2010 | Microsoft Visual Studio 2010.
2. From the Visual Studio 2010 menu, select File | New | Project.
3. Select the Visual C# | SharePoint | 2010 | List Definition project template.
4.you can Enter any name like Bugs in the Name textbox.
5. Entery yourlocal location on your Computer in the Location textbox.
6. Click Ok.
7. In the SharePoint Customization Wizard:
8. Enter http://intranet.local.com/ for the local site. 

Image Loading

9. Set the trust level to Deploy as a farm solution.
10. Click Next.
11. Enter Bugs in the What is the display name of the list definition? textbox.
12. Select Custom List in the What is the type of the list definition? drop-down box.

Tick Add a list instance for this list definition

Image Loading

14. Click Finish.

Customize SharePoint 2010 List Definition and List Instance

Customizing the List Definition project template by changing the list name, the content type it stores, and the fields that are displayed in the new, edit, and display forms.

1. In the Solution Explorer, expand ListInstance1 and open the Elements.xml file. 

Image Loading

2.Within the ListInstance element change the Title attribute to Bugs and change the TemplateType attribute to 10001.

Image Loading

3. In the Solution Explorer, open Elements.xml.

Image Loading

4. Within the ListTemplate element, change the Type attribute to 10001 and add the DisallowContentTypes=”FALSE” attribute, as shown below. DisallowContentTypes="FALSE" 

Image Loading
Image Loading

5.Insert the following xml into the top of the Elements element in the Elements.xml file. This XML describes the Fields the Bug Item content type uses.

Image Loading

6.Insert the following xml into the top of the Elements element in the Elements.xml file. This XML describes the Bug Item content type the list will store.

Image Loading
Image Loading

7.The Elements.xml file should now look like the following.

Image Loading

8. In the Solution Explorer, open Schema.xml

Image Loading

9. Add the EnableContentTypes=”TRUE” attribute to the List element inside of the Schema.xml file.

Image Loading

10. Insert the following XML into the ContentTypes element in the schema.xml file. This XML describes the Bug Item content type this list will store.

Image Loading

11. Insert the following XML into the Fields element. This XML describes the fields the list will store. These are directly related to the fields in the Content Type we added in the previous step.

Image Loading

12. Insert the following XML into the ViewFields element in the 2nd view, BaseViewID="1". This XML describes which fields should be visible in this particular view. BaseView 1 is set as the default view and this is the view the newly created fields should display in.

Image Loading

13. From the menu, select Build | Deploy Bugs.
14. Open http://intranet.usama.com in a browser session. Under Lists in the left-side navigation, click on Bugs.

Image Loading
Image Loading
Image Loading

Final Output 

Image Loading

22. You have successfully customized the List Definition and List Instance.

 
Sign Up to vote for this article
 
About Author
 
usamawahabkhan
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Pakistan
Joined date-06 May 2010
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
    In this article,I will speak that is as useful as a headache.
    Published Date : 30/Jun/2010
    Now its a time user need Rich User Interface with high level of interactivity that is easily possible with xhtml technologies
    Published Date : 21/Jun/2010
    Difference between MOSS and WSS
    Published Date : 16/Feb/2010
    In this article, I am going to give and walkthrough of how to define a custom Content type in MOSS or SharePoint.
    Published Date : 16/Feb/2010
    Recently I have involved in branding one of our clients sharepoint portal. As part of the branding process we needed to modify the application.master file, so even the layout pages will have the same look and feel. As part of the investigation, we come up with the best approach for doing this.
    Published Date : 05/Sep/2010
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top