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 설정 CurrentEditItemnull 컬렉션 뷰를 편집 상태를 종료 하 고 있습니다. 하는 경우 CanCancelEdit 됩니다 true, CancelEdit 도 편집된 된 개체의 원래 값을 복원 합니다.

적용 대상