Property Events
The property grid has several property events that get raised in various scenarios.
Note
Since PropertyGrid indirectly inherits TreeListBox, all of the events described for that control such as those related to selection, expansion, etc. apply to property grid as well.
Property Change Events
The OnPropertyValueChanging and PropertyValueChanged events are raised before and after, respectively, a property's value is updated through the property grid. The event arguments for both events include the PropertyModelValueChangeEventArgs.PropertyModel being changed and the new Value.
To cancel an update to the property value, handle the OnPropertyValueChanging event and set e.Cancel
to true
. This will prevent the new value from being assigned and will not raise the PropertyValueChanged event.
Collection Change Events
When a property model represents a collection property, there are several events relating to the adding and removing of child items.
See the Collections topic for a description of each of these events and when they occur.