I have an ItemUpdated Event bound to a list and do not want it to fire when the List item is edited in Datasheet view. Is there a way to detect if the User is editing through the Datasheet?
1 Answer
You have DisableEventFiring in SharePoint use EventFiringEnabled = false; I am not able to understand in what context you mean to use it but yes Event firing can be disabled Check here for more details. Alternatively you can declare a boolean variable and use as below
bool isEdited = false; protected override void onItemEdited(SPItemEventProperties properties) { isEdited=true; } protected override void onItemUpdated(SPItemEventProperties properties) { if(!isEdited) { //your code } } - yup, I know about that flag but I guess the question is more geared towards detecting Datasheet mode from the serverMichael Colbs– Michael Colbs2015-04-29 21:01:28 +00:00Commented Apr 29, 2015 at 21:01