Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a List definition in Visual Studio which is instantiated using a List Instance. This list definition has an event receiver which overrides the ListAdded event.

I am able to get the ListAdded event to fire if I create a list based on the definition through the SharePoint UI but this does not fire when the list is created using the List Instance.

Is this a bug or a feature?

Thanks,

Alex

share|improve this question
add comment

1 Answer

I would say that it is a feature. Because a ListInstance element has to be included into a feature, you would be able to do some code behind on the FeatureActivated event of the feature...

That way, you have a more powerful control on your full solution, which you don't have with just the ItemAdded of the List events.

share|improve this answer
    
The problem is that the methods in FeatureActivated aren't being fired when the list is created via the ListInstance, only via the SharePoint UI. Have you or anyone else seen this? –  James Love Dec 22 '10 at 15:54
    
I never had any difficulties at that level... My code is always fired when I activate a ListInstance... Even from a feature activation from code behind! –  Sébastien Levert Dec 22 '10 at 19:55
add comment

Your Answer

 
discard

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