ListViewCancelMode 열거형

정의

항목에서 ListView 단추를 클릭했을 때 사용자가 수행한 작업 유형을 결정합니다.

public enum class ListViewCancelMode
public enum ListViewCancelMode
type ListViewCancelMode = 
Public Enum ListViewCancelMode
상속
ListViewCancelMode

필드

Name Description
CancelingEdit 0

사용자가 편집 작업을 취소했습니다.

CancelingInsert 1

사용자가 삽입 작업을 취소했습니다.

예제

다음 예제에서는 열거형을 ListViewCancelMode 사용하여 항목에서 ListView 취소되는 작업을 확인하는 방법을 보여줍니다.

protected void ContactsListView_ItemCanceling(object sender, ListViewCancelEventArgs e)
{
  //Check the operation that raised the event
  if (e.CancelMode == ListViewCancelMode.CancelingEdit)
  {
    // The update operation was canceled. Display the 
    // primary key of the item.
    Message.Text = "Update for the ContactID " + 
      ContactsListView.DataKeys[e.ItemIndex].Value.ToString()  + " canceled.";
  }
  else
  {
    Message.Text = "Insert operation canceled."; 
  }
}
Protected Sub ContactsListView_ItemCanceling(ByVal sender As Object, _
                                             ByVal e As ListViewCancelEventArgs)
  'Check the operation that raised the event
  If (e.CancelMode = ListViewCancelMode.CancelingEdit) Then
    ' The update operation was canceled. Display the 
    ' primary key of the item.
    Message.Text = "Update for the ContactID " & _
      ContactsListView.DataKeys(e.ItemIndex).Value.ToString() & " canceled."
  Else
    Message.Text = "Insert operation canceled."
  End If

End Sub

설명

ListViewCancelMode 열거형은 항목에서 취소 단추를 클릭 ListView 할 때 사용자가 수행했던 작업의 유형을 나타내는 데 사용됩니다. 취소 단추는 속성이 CommandName "취소"로 설정된 단추입니다.

적용 대상

추가 정보