DataRowView.EndEdit 方法

定义

提交基础 DataRow 的更改并结束使用 BeginEdit()启动的编辑会话。Commits changes to the underlying DataRow and ends the editing session that was begun with BeginEdit(). 使用 CancelEdit() 放弃对 DataRow 所做的更改。Use CancelEdit() to discard the changes made to the DataRow.

public:
 virtual void EndEdit();
public void EndEdit ();
abstract member EndEdit : unit -> unit
override this.EndEdit : unit -> unit
Public Sub EndEdit ()

实现

示例

下面的示例在中编辑行 DataViewThe following example edits a row in a DataView. BeginEdit在之前调用,然后调用 EndEditcalling the BeginEdit before, and EndEdit afterwards.


Private Sub EditRow(view As DataView)
    view.AllowEdit = True
    view(0).BeginEdit
    view(0)("FirstName") = "Mary"
    view(0)("LastName") = "Jones"
    view(0).EndEdit
End Sub

适用于

另请参阅