asp.net.ph

DataRow.BeginEdit Method

System.Data Namespace   DataRow Class


Begins an edit operation on a DataRow object.

[ VB ]
Public Sub BeginEdit ( )

[ C# ]
void BeginEdit ( );

[ C++ ]
public: void BeginEdit ( );

[ JScript ]
public function BeginEdit ( );

Exceptions


Exception Type Condition
InRowChangingEventException Occurs when the method was called inside the RowChanging event.
DeletedRowInaccessibleException Occurs when the method was called upon a deleted row.

Remarks

Use the BeginEdit method to put a DataRow into edit mode. In this mode, events are temporarily suspended allowing the user to make multiple changes to more than one row without triggering validation rules. For example, if the values of several rows must add up to 100, you can put each of the rows into edit mode to suspend the validation of the row values until the user attempts to commit the values.

The BeginEdit method is called implicitly when the user changes the value of a data-bound control; the EndEdit method is called implicitly when you invoke the DataTable object's AcceptChanges method.

While in this edit mode, the DataRow stores representations of the original and new proposed values. Therefore, as long as the EndEdit method has not been called, you can retrieve either the original or proposed version by passing either DataRowVersion.Original or DataRowVersion.Proposed for the version parameter of the Item property. You can also cancel any edits at this time by invoking the CancelEdit method.

To see if the row contains an original or proposed value, call the HasVersion method.

See Also

DataRow Members   AcceptChanges   CancelEdit   EndEdit   HasVersion   Item   RowState Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph