Skip to main content
.NET Framework 4.5.2+

DeleteObjectsViewController.DeleteAction Property

Provides access to the DeleteObjectsViewController‘s Delete Action.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public SimpleAction DeleteAction { get; }

Property Value

Type Description
SimpleAction

A SimpleAction object representing the Delete Action.

Remarks

The Delete Action is intended to delete object(s) selected in the current View:

In a Windows Forms application:

DeleteAction

In an ASP.NET Web Forms application:

DeleteAction_Web

This Action’s Execute event is handled by the DeleteObjectsViewController‘s Delete protected method (see the class description). If you need to modify the way this Action is executed, inherit from this Controller and override the Delete method. Alternatively, handle the DeleteObjectsViewController.Deleting event. It provides access to the collection of objects to be deleted. You can change this collection. To do this, use the event handler’s DeletingEventArgs.Objects parameter.

By default, the object(s) from a root View (see View.IsRoot) is deleted immediately. The objects deleted from a nested View (not root View) are only marked as objects to be deleted. They will be removed during the next call of the BaseObjectSpace.CommitChanges method. To change this behavior, use the DeleteObjectsViewController.AutoCommit property.

By default, the Delete Action is active (visible) under the following conditions:

  • The current View is not read-only.
  • The current View is a root Detail View (see View.IsRoot) or any List View.
  • The applied Security System allows deletion from the current object collection.
  • The IModelView.AllowDelete property is set to true.
  • The object(s) to be deleted is persistent.
  • The object to be deleted from a Detail View is not new.

For more information of how to hide the Actions, refer to the ActionBase.Active topic.

To ascertain why the Delete Action is currently deactivated or disabled, use the DiagnosticInfo Action. If you need to change the Action’s “active” or “enabled” state in code, use its ActionBase.Active or ActionBase.Enabled property, respectively.

Information on the Delete Action is available in the Application Model‘s ActionDesign node. To access it, use the Model Editor.

See Also