How do I disable event firing in code that is not part of an ItemReceiver?

E.g.: I have an FeatureActivated event receiver which update a list (adds column) and updates all items to populate the new column. I want to do this without firing the 'ItemUpdated'-event for all items in the list.

  • What I don't understand is : Events firing may be disabled for which SharePoint objects/area/domain/scope : web ? Farm ? list ? Item ? Where is the association made ? Many thanks
    – user16325
    Apr 12 '13 at 15:07
  • @user16325 See this Question: sharepoint.stackexchange.com/questions/20261/…
    – Dribbel
    Apr 13 '13 at 15:42

You can use this approach - create class:

public class DisabledItemEventsScope : SPItemEventReceiver, IDisposable
    private readonly bool oldValue;

    public DisabledItemEventsScope()
        oldValue = EventFiringEnabled;
        EventFiringEnabled = false;

    #region IDisposable Members

    public void Dispose()
        EventFiringEnabled = oldValue;



using (var scope = new DisabledItemEventsScope())

from here

  • Nice and clean!
    – Dribbel
    Mar 15 '12 at 15:00
  • Should this work for updating any item properties without firing an event, or just in that specific situation?
    – thanby
    Jan 24 '13 at 14:16
  • This will work for any item update Jan 24 '13 at 14:48
  • What if I need to disable event firing on a list, i.e. when I don't have the context of the list in question. I have some SharePoint web part code that needs to update a property of an item in a list. And I want to disable event firing when updating the property of that item, since the list has a registered event receiver.
    – Web User
    Jan 6 '16 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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