Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SpreadsheetControl.ShapeRemoving Event

Occurs before a drawing object is removed from a worksheet.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v24.2.dll

NuGet Package: DevExpress.Win.Spreadsheet

#Declaration

public event ShapeChangingEventHandler ShapeRemoving

#Event Data

The ShapeRemoving event's data class is ShapeChangingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
ShapeId Gets the ID value of the drawing object being removed.
ShapeType Gets the type of the drawing object being removed.

#Remarks

The ShapeRemoving event allows you to perform any actions before an end-user removes a drawing object in the SpreadsheetControl‘s UI. To obtain the type of the drawing object for which the event has been raised, use the event parameter’s ShapeType property. You can prevent a drawing object from being removed by setting the Cancel property to true.

After a drawing object has been removed, the SpreadsheetControl.ShapeRemoved event is raised.

Note

By default, the ShapeRemoving event does not occur when removing a drawing object in code. However, this event will also be triggered by changes made via an API if you set the WorkbookEventOptions.RaiseOnModificationsViaAPI property (accessible via the SpreadsheetControl.Options.Events.RaiseOnModificationsViaAPI notation) to true.

See Also