SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to Create List Definition & List Instance under particular Sub-site.It can not been seen under site Collection.

share|improve this question

Create your List Definition using a Web Scoped feature. Set the feature attributes to Hidden=True.

You can then activate your feature manually using PowerShell for that sub-site.

For further automation you can either staple your feature to specific templates (so it is automatically included in sites which uses a specific template) or reference it in the WebFeatures element in the Onet.xml of your custom site definition.

share|improve this answer
up vote 1 down vote accepted

Accomplished with the following code in Feature Activated event receiver.

SPSite site = null;
SPWeb web = null;
site = properties.Feature.Parent as SPSite;
web = site.AllWebs["SubSite"];
SPListTemplate temp = web.ListTemplates["ListDefinition"];
Guid newg = web.Lists.Add("ListInstance", "Description", temp);
SPList newlist = web.Lists[newg];
newlist.OnQuickLaunch = true;
share|improve this answer
This will make List Named listInstance on Custom ListDefinition named listDefinition. – Harsh Bhavsar Jun 12 '13 at 9:04
Thanks Robert.. – Harsh Bhavsar Jun 12 '13 at 9:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.