CancelEdit
DataRow.CancelEdit();
Cancels the edit on the DataRow
, discarding the
changes.
Updates to a row can be buffered by calling the BeginEdit( )
, EndEdit( )
, and CancelEdit( )
methods. The BeginEdit( )
method turns
off all constraints and suspends events that enforce validation
rules. If CancelEdit( )
is called, the changes in
the buffer are discarded. When EndEdit( )
is
called, the data is validated against the constraints, and events are
raised if any violations occur.
Prior to EndEdit( )
being called, any changes made
to values for the row are stored as a proposed value. Until
EndEdit( )
is called, both the original value and
the proposed value can be retrieved by specifying the
Original
or Proposed
as the
optional DataRowVersion
argument for the
Item
property. While the row is being edited, the
proposed value is returned by default.
The HasVersion( )
method can be called to
determine whether the row has an Original
or
Proposed
value.