ListViewCancelMode 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
항목에서 ListView 단추를 클릭했을 때 사용자가 수행한 작업 유형을 결정합니다.
public enum class ListViewCancelMode
public enum ListViewCancelMode
type ListViewCancelMode =
Public Enum 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 "취소"로 설정된 단추입니다.