IEditableObject.CancelEdit Method

Definition

放弃上一次 BeginEdit() 调用之后的更改。Discards changes since the last BeginEdit() call.

public:
 void CancelEdit();
public void CancelEdit ();
abstract member CancelEdit : unit -> unit
Public Sub CancelEdit ()

Remarks

此方法通常用于捕获 DataRowViewCancelEdit 语义。This method is typically used to capture the CancelEdit semantics of a DataRowView.

如果在未编辑的对象上调用此方法,则将忽略此方法。This method will be ignored if called on an object that is not being edited.

Note

如果所属列表实现 IBindingList,则在使用 IBindingList.AddNew 创建的对象上调用 CancelEdit 会丢弃该对象。If the owning list implements IBindingList, calling CancelEdit on an object created using IBindingList.AddNew discards the object.

Applies to