ListViewCancelMode Enum

Definition

Determines the type of operation that the user was performing when the Cancel button was clicked in a ListView item.

C#
public enum ListViewCancelMode
Inheritance
ListViewCancelMode

Fields

Name Value Description
CancelingEdit 0

The user canceled an edit operation.

CancelingInsert 1

The user canceled an insert operation.

Examples

The following example shows how to use the ListViewCancelMode enumeration to check which operation is being canceled in a ListView item.

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

Remarks

The ListViewCancelMode enumeration is used to represent the type of operation that the user was performing when the Cancel button was clicked in a ListView item. (A Cancel button is a button whose CommandName property set to "Cancel".)

Applies to

Product Versions
.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

See also