Skip to main content
3 of 4
added 795 characters in body
Ali Jafer
  • 17.8k
  • 1
  • 28
  • 41

you can do it through code:

as an example:

SPList list = web.Lists["My List"];
list.EnableVersioning = true;

so the above can be simply added to your code when your creating the list:

somthing on the lines of:

//get web object from context
SPWeb web = SPContext.Current.Web;
//get list collection
SPListCollection lists = Web.Lists;
//add list to list collection
lists.Add("My List", "My list for user input form", SPListTemplateType.GenericList);
//call list that we just made
SPList newMyList = Web.Lists["My List"];
//enable versioning on that list
newMyList.EnableVersioning = true;

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.enableversioning.aspx

EDIT

i get you! when adding the list using vs2012 you can go into the xml of the list (Elements.xml ):

<ListInstance 
  CustomSchema = string
  Description = "Text"
  DocumentTemplate = integer
  FeatureId = "Text"
  Hidden = "TRUE" | "FALSE"
  HyperlinkBaseUrl = string
  Id = Text
  OnQuickLaunch = "TRUE" | "FALSE"
  QuickLaunchUrl = "Text"
  RootWebOnly = "TRUE" | "FALSE"
  TemplateType = Integer
  Title = "Text"
  Url = "Text"
  VersioningEnabled = "TRUE" | "FALSE"
</ListInstance>

the above is appended within the list elements.xml as you can see within ListInstance you have VersioningEnabled, just add that like so: VersioningEnabled = true and versioning is enabled to that custom list.

Ali Jafer
  • 17.8k
  • 1
  • 28
  • 41