IEditableCollectionView.CancelEdit 메서드

정의

편집 트랜잭션을 종료하고 가능하면 원래 값을 항목으로 복원합니다.

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

예제

다음 예제에서는 CanCancelEdit 편집된 항목의 원래 값을 호출 CancelEdit하기 전에 복원할 수 있는지 여부를 확인합니다. 값을 복원할 수 없는 경우 추가 논리를 제공해야 합니다. 가능한 경우 예제에서 호출 CancelEdit할 때 값이 복원됩니다. 전체 샘플은 IEditableCollectionView 샘플을 사용하여 컬렉션 변경을 참조하세요.

// If the objects in the collection can discard pending 
// changes, calling IEditableCollectionView.CancelEdit
// will revert the changes. Otherwise, you must provide
// your own logic to revert the changes in the object.

if (!editableCollectionView.CanCancelEdit)
{
    // Provide logic to revert changes.
}

editableCollectionView.CancelEdit();
' If the objects in the collection can discard pending 
' changes, calling IEditableCollectionView.CancelEdit
' will revert the changes. Otherwise, you must provide
' your own logic to revert the changes in the object.

If Not editableCollectionView.CanCancelEdit Then
    ' Provide logic to revert changes.
End If

editableCollectionView.CancelEdit()

설명

CancelEdit 을 설정 CurrentEditItem 하여 null 컬렉션 뷰가 편집 상태를 종료하도록 합니다. 이 CanCancelEdittrue 경우 CancelEdit 편집된 개체의 원래 값도 복원합니다.

적용 대상