Use the CancelCreateRow event
- Last Updated: February 10, 2023
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Syntax
The ProBindingSource publishes the CancelCreateRow event when the user
cancels adding a new record through a bound UI control. This event uses an OpenEdge built-in
class, Progress.Data.CancelCreateRowEventArgs, that extends the .NET System.EventArgs class to pass the event arguments. The event argument class
uses the BufferHdl and BufferName properties to pass the handle and name of the buffer for
the appropriate table in the bound ProDataSet. If the bound ABL data source object is a
query, these properties correspond to the query's buffer. If the query is a join query, they
contain the buffer data for the first buffer in the query.
An event handler for this event uses the following syntax:
|
Where EventHandlerName is the name of the event handler, sender is the object reference to the ProBindingSource, and args is the object reference to the CancelCreateRowEventArgs instance that contains the event arguments.
The event handler then needs to delete both the previously created row and the corresponding record in the result set. This keeps the data in the bound UI control synchronized with the ABL data source object.