ListViewUpdatedEventArgs.KeepInEditMode 속성

정의

업데이트 작업 후 ListView 컨트롤을 편집 모드로 유지할지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool KeepInEditMode { bool get(); void set(bool value); };
public bool KeepInEditMode { get; set; }
member this.KeepInEditMode : bool with get, set
Public Property KeepInEditMode As Boolean

속성 값

업데이트 작업 후 컨트롤을 편집 모드로 유지해야 하면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 KeepInEditMode 유지 하는 속성을 ListView 예외가 발생 하면 편집 모드에서 컨트롤입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 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

설명

기본적으로 ListView 컨트롤이 업데이트 작업 후 읽기 전용 모드로 돌아갑니다. 설정 합니다 KeepInEditMode 속성을 true 지정 하는 ListView 컨트롤이 편집 모드로 유지 해야 합니다. 이 사용자가 입력 한 값도 유지 합니다.

적용 대상

추가 정보