英語で読む

次の方法で共有


ListViewCancelMode 列挙型

定義

ListView 項目で [キャンセル] ボタンがクリックされたときにユーザーが実行していた操作の種類を判断します。

C#
public enum ListViewCancelMode
継承
ListViewCancelMode

フィールド

名前 説明
CancelingEdit 0

ユーザーは編集操作をキャンセルしました。

CancelingInsert 1

ユーザーは挿入操作をキャンセルしました。

次の例では、 列挙を使用 ListViewCancelMode して、アイテムで取り消されている操作を確認する方法を ListView 示します。

C#
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."; 
  }
}

注釈

ListViewCancelMode列挙体は、アイテムの [キャンセル] ボタンがクリックされたときにユーザーが実行していた操作の種類をListView表すために使用されます。 ([キャンセル] ボタンは、プロパティが CommandName "Cancel" に設定されているボタンです)。

適用対象

製品 バージョン
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

こちらもご覧ください