Skip to main content
A newer version of this page is available. .

SpreadsheetControl.SheetRemoving Event

Occurs when a worksheet is about to be removed from a workbook.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v19.1.dll

Declaration

public event SheetRemovingEventHandler SheetRemoving

Event Data

The SheetRemoving event's data class is SheetRemovingEventArgs. 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.

Remarks

The SheetRemoving event allows you to perform any actions before an end-user removes a worksheet from a workbook using the control’s UI. You can cancel removing a worksheet by setting the event parameter’s Cancel property to true.

After a worksheet has been removed from a workbook, the SpreadsheetControl.SheetRemoved event is raised.

Note

By default, the SheetRemoving event does not occur when removing a worksheet 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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SheetRemoving event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also