ListViewUpdatedEventArgs.Exception 속성

정의

업데이트 작업 중에 발생한 예외(있을 경우)를 가져옵니다.

public:
 property Exception ^ Exception { Exception ^ get(); };
public Exception Exception { get; }
member this.Exception : Exception
Public ReadOnly Property Exception As Exception

속성 값

Exception

업데이트 작업 중에 발생한 예외(있을 경우)이거나, 예외가 발생하지 않은 경우에는 null입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 Exception 속성 업데이트 작업 중에 예외가 발생 한 것인지 확인 합니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ListViewUpdatedEventArgs 클래스입니다.

void ContactsListView_ItemUpdated(Object sender, ListViewUpdatedEventArgs e)
{
    if (e.Exception != null)
    {
        if (e.AffectedRows == 0)
        {
            e.KeepInEditMode = true;
            Message.Text = "An exception occurred updating the contact. " +
                                "Please verify your values and try again.";
        }
        else
            Message.Text = "An exception occurred updating the contact. " +
                                "Please verify the values in the recently updated item.";

        e.ExceptionHandled = true;
    }
}
Sub ContactsListView_ItemUpdated(sender As Object, e As ListViewUpdatedEventArgs)
    If e.Exception IsNot Nothing Then
        If e.AffectedRows = 0 Then
            e.KeepInEditMode = True
            Message.Text = "An exception occurred updating the contact. " & _
                                "Please verify your values and try again."
        Else
            Message.Text = "An exception occurred updating the contact. " & _
                                "Please verify the values in the recently updated item."
        End If

        e.ExceptionHandled = True
    End If
End Sub

설명

사용 하 여는 Exception (있는 경우) 예외를 확인 하려면 속성을 업데이트 작업 중에 발생 합니다. 이 속성을 반환 하는 경우 예외가 발생 하지, null합니다.

참고

예외가 발생 한 이벤트 처리기를 설정에 예외를 처리 하는 경우는 ExceptionHandled 속성을 true입니다. 이 고, 그렇지는 ListView 컨트롤이 다시 예외를 throw 합니다.

적용 대상

추가 정보