//First Create New Project
//Add new Item and select sharepoint 2010==> List Defination Template==>Click ok
//Next page select Farm Solution and specify site collection url when we need to create this
//Next step mention List dafination display name and there type like Custome list or anything==>Click on Finish
//Then two .xml files we get
//•Elements.xml
// •Schema.xml
//Following are code in Elements.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Do not change the value of the Name attribute below. If it does not
match the folder name of the List Definition project item,
an error will occur when the project is run. -->
<ListTemplate
Name="ComputerConfiguration"
Type="10000"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="Computer Configuration"
Description="Computer Configuration"
Image="/_layouts/images/itgen.png"/>
</Elements>
//we can modify List defination name and description from above code
//After that Create Fields for List defination
//For adding a List Definition we have to use the following tags:
//•Field
//•FieldRef
//The Field tag is used to represent new field information like the Name, Display Name, ID, Type etc. The FieldRef tag is used
//to refer to an existing field using the Name.
//Open Schema.xml and add the following fields.
<Fields>
<Field ID="{24B3F6C1-B75B-4821-A466-C1E979B87B81}" Name="Manufacturer Name" DisplayName="Manufacturer Name" Type="Text" Required="TRUE"/>
<Field ID="{24B3F6C1-B75B-4821-A466-C1E979B87B82}" Name="Model Name" DisplayName="Model Name" Type="Text" Required="TRUE"/>
<Field ID="{24B3F6C1-B75B-4821-A466-C1E979B87B83}" Name="CPU" DisplayName="CPU" Type="Choice" Required="TRUE">
<CHOICES>
<CHOICE>IntelTest</CHOICE>
<CHOICE>AMDTest</CHOICE>
<CHOICE>OtherTest</CHOICE>
</CHOICES>
</Field>
<Field ID="{24B3F6C1-B75B-4821-A466-C1E979B87B84}" Name="Speed" DisplayName="Speed (GHz)" Type="Number"/>
<Field ID="{24B3F6C1-B75B-4821-A466-C1E979B87B85}" Name="RAM" DisplayName="RAM (GB)" Type="Number"/>
<Field ID="{24B3F6C1-B75B-4821-A466-C1E979B87B86}" Name="Cost" DisplayName="Cost" Type="Number"/>
<Field ID="{24B3F6C1-B75B-4821-A466-C1E979B87B87}" Name="Description" DisplayName="Description" Type="Number"/>
</Fields>
//Now we can add the required fields to the View of the list instance.
//•Manufacturer Name
// •Model Name
// •CPU
// •Cost
//And Add Field Ref in same after above code
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main"
DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;"
DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE"
SetupPath="pages\viewpage.aspx"
ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="Manufacturer Name"></FieldRef>
<FieldRef Name="Model Name"></FieldRef>
<FieldRef Name="CPU"></FieldRef>
<FieldRef Name="Cost"></FieldRef>
</ViewFields>This code snippet for Create Custom List Definition in SharePoint.
