Example These statements update the dialog box component that has the number item Num.
We inherit SPItem Event Receiver and IDisposable, SPItem Event Receiver will give us access to the base properties in the event receiver and IDisposable will give us a Dispose method (which comes in handy in a moment).
SPItem Event Receiver has a property called Event Firing Enabled, which simply indicates whether event firing is enabled.
We can turn this off to prevent our loop from occuring.
The Item Update command can be used for many things; possible uses include enabling or disabling buttons, changing the range of a pop-up, updating a sliders position, and updating editable text items if the user enters an invalid value.
You may want to update individual items in a dialog box depending on user input, user interaction, or to display underlying data.
Although you would typically update an items #value, you can also update everything else about an item, except for its type.
Set the height, width, loc H, and loc V properties to -1 to keep their current values.
Item Updated(properties); SPList Item list Item = properties.
List Item; list Item["Title" ] = "A cool new title! Update(); } In this Item Updated event, we are simply assigning the current List Item to a new SPList Item object, changing its "Title" property, and updating it. However, this simple piece of code will cause an endless loop, as each time you call list Item. As you can see, we need a way to prevent this loop from occuring.
Luckily there is an easy and elegant solution with a little custom code.
We'll create a class called Disabled Events Scope: This class is simple and to the point.