[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Collapse]Spreadsheet
   [Expand]Product Information
    Product Structure
    Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
    Data Grouping
   [Expand]Pivot Tables
   [Expand]Charts and Graphics
    Printing
    Events
   [Expand]Mail Merge
    Protection
    Find and Replace
   [Expand]Visual Elements
    Services
   [Expand]Keyboard Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Events

This topic provides a list of WinForms Spreadsheet events. These events allow you to:

Expanded Track User Activity

The table below lists events the Spreadsheet control raises in response to user actions.

User Action

Events

Create a blank workbook.

SpreadsheetControl.DocumentClosing

SpreadsheetControl.InitializeDocument

SpreadsheetControl.EmptyDocumentCreated

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Load a workbook.

SpreadsheetControl.DocumentClosing

SpreadsheetControl.BeforeImport

SpreadsheetControl.InitializeDocument

SpreadsheetControl.DocumentLoaded

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Save a workbook.

SpreadsheetControl.BeforeExport

SpreadsheetControl.ModifiedChanged

SpreadsheetControl.PropertyChanged

SpreadsheetControl.DocumentSaved

Print a workbook.

SpreadsheetControl.BeforePrintSheet

Insert a new worksheet.

SpreadsheetControl.SheetInserted

SpreadsheetControl.ActiveSheetChanging

SpreadsheetControl.ActiveSheetChanged

SpreadsheetControl.UpdateUI

Click a worksheet's tab on the Sheet Tab Selector.

SpreadsheetControl.ActiveSheetChanging

SpreadsheetControl.ActiveSheetChanged

SpreadsheetControl.UpdateUI

Rename a worksheet.

SpreadsheetControl.SheetRenaming

SpreadsheetControl.SheetRenamed

SpreadsheetControl.UpdateUI

Delete a worksheet.

SpreadsheetControl.SheetRemoving

SpreadsheetControl.ActiveSheetChanged

SpreadsheetControl.SheetRemoved

SpreadsheetControl.UpdateUI

Scroll a worksheet.

SpreadsheetControl.ScrollPositionChanged

Insert columns in a worksheet.

SpreadsheetControl.ColumnsInserting

SpreadsheetControl.ColumnsInserted

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Remove columns from a worksheet.

SpreadsheetControl.ColumnsRemoving

SpreadsheetControl.ColumnsRemoved

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Insert rows in a worksheet.

SpreadsheetControl.RowsInserting

SpreadsheetControl.RowsInserted

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Remove rows from a worksheet.

SpreadsheetControl.RowsRemoving

SpreadsheetControl.RowsRemoved

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Freeze rows and columns.

SpreadsheetControl.PanesFrozen

SpreadsheetControl.ScrollPositionChanged

SpreadsheetControl.UpdateUI

Unfreeze rows and columns.

SpreadsheetControl.PanesUnfrozen

SpreadsheetControl.ScrollPositionChanged

SpreadsheetControl.UpdateUI

Select cells, rows, columns, or drawing objects on a worksheet.

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Activate a cell's in-place editor or formula bar, and begin to edit the cell's value.

SpreadsheetControl.CellBeginEdit

SpreadsheetControl.UpdateUI

Finish editing a cell and close the in-place editor.

SpreadsheetControl.CellEndEdit

SpreadsheetControl.CellValueChanged

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Click Enter on the formula bar to commit a value to a cell.

SpreadsheetControl.CellEndEdit

SpreadsheetControl.CellValueChanged

SpreadsheetControl.ContentChanged

SpreadsheetFormulaBar.OkButtonClick

SpreadsheetControl.UpdateUI

Press the ESC key to cancel the input.

SpreadsheetFormulaBar.Rollback

SpreadsheetControl.CellCancelEdit

SpreadsheetControl.UpdateUI

Click Cancel on the formula bar to cancel the input.

SpreadsheetFormulaBar.Rollback

SpreadsheetControl.CellCancelEdit

SpreadsheetFormulaBar.CancelButtonClick

SpreadsheetControl.UpdateUI

Apply formatting to cells.

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Create a defined name.

SpreadsheetControl.DefinedNameValidating

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Edit a defined name.

SpreadsheetControl.DefinedNameEditing

SpreadsheetControl.DefinedNameValidating

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Remove a defined name.

SpreadsheetControl.DefinedNameDeleting

SpreadsheetControl.ContentChanged

SpreadsheetControl.UpdateUI

Insert an image or chart.

SpreadsheetControl.ShapeInserted

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Remove a drawing object.

SpreadsheetControl.ShapeRemoving

SpreadsheetControl.ShapeRemoved

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Copy the selected cell range.

SpreadsheetControl.RangeCopying

SpreadsheetControl.RangeCopied

Copy a drawing object.

SpreadsheetControl.ShapesCopying

Paste a cell range copied from the current workbook.

SpreadsheetControl.CopiedRangePasting

SpreadsheetControl.CellValueChanged

SpreadsheetControl.CopiedRangePasted

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Paste data from an external application or a cell's in-place editor.

SpreadsheetControl.ClipboardDataPasting

SpreadsheetControl.ClipboardDataObtained

SpreadsheetControl.CellValueChanged

SpreadsheetControl.ClipboardDataPasted

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Paste a copied drawing object.

SpreadsheetControl.ShapeInserted

SpreadsheetControl.ClipboardDataPasted

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Drag and drop the selected cell range.

SpreadsheetControl.BeforeDragRange

SpreadsheetControl.BeforeDropRange

SpreadsheetControl.CellValueChanged

SpreadsheetControl.AfterDropRange

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Drag the fill handle to populate the adjacent cells with data.

SpreadsheetControl.BeforeDragRange

SpreadsheetControl.BeforeDropRange

SpreadsheetControl.CellValueChanged

SpreadsheetControl.AfterDropRange

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Insert a comment.

SpreadsheetControl.CommentInserting

SpreadsheetControl.CommentInserted

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Remove a comment.

SpreadsheetControl.CommentRemoving

SpreadsheetControl.CommentRemoved

SpreadsheetControl.ContentChanged

SpreadsheetControl.SelectionChanged

SpreadsheetControl.UpdateUI

Click a hyperlink.

SpreadsheetControl.HyperlinkClick

Change the zoom level.

SpreadsheetControl.ZoomChanged

SpreadsheetControl.UpdateUI

Specify or edit document properties.

SpreadsheetControl.DocumentPropertiesChanged

Right-click the Spreadsheet control's visual element.

SpreadsheetControl.PopupMenuShowing

Expanded Customize Spreadsheet Elements

Use the following events to customize the Spreadsheet control's appearance and behavior:

Events

Description

SpreadsheetControl.CustomDrawCell,

SpreadsheetControl.CustomDrawCellBackground

Allow you to customize the cell appearance.

SpreadsheetControl.CustomDrawColumnHeader,

SpreadsheetControl.CustomDrawColumnHeaderBackground

Allow you to customize the appearance of column headers.

SpreadsheetControl.CustomDrawRowHeader,

SpreadsheetControl.CustomDrawRowHeaderBackground

Allow you to customize the appearance of row headers.

SpreadsheetControl.CustomDrawCommentIndicator

Allows you to customize comment indicators.

SpreadsheetControl.CustomDrawFrozenPaneBorder

Allows you to customize frozen pane borders.

SpreadsheetControl.CustomCellEdit

Allows you to assign a custom in-place editor to a cell.

Expanded Handle Exceptions

Handle the SpreadsheetControl.InvalidFormatException and SpreadsheetControl.UnhandledException events to catch exceptions that the Spreadsheet control does not process.

The SpreadsheetControl.InvalidFormatException event fires when a user attempts to load a document in an unsupported format.

The SpreadsheetControl.UnhandledException event allows you to catch exceptions that can occur when users execute commands via the Spreadsheet's UI. For instance, when they attempt to save a document to a locked or read-only file.

Expanded Track Changes in a Document

The SpreadsheetControl.ContentChanged and SpreadsheetControl.ModifiedChanged events indicate that the current document was modified.

The SpreadsheetControl.ContentChanged event occurs each time the document's content changes. When you use API methods to specify a cell's value or format a cell, this leads to significant changes in the internal document model, and the ContentChanged event fires twice.

The SpreadsheetControl.ModifiedChanged event indicates that the current document was modified since it was loaded or last saved and the SpreadsheetControl.Modified property's value changed. The SpreadsheetControl.ModifiedChanged event is also raised when you save the document because the SpreadsheetControl.Modified property's value changes to false.

Expanded Track Modifications in Code

The Spreadsheet control raises events in response to changes in code. For instance, the SpreadsheetControl.PropertyChanged event fires each time a SpreadsheetControl's property changes. The SpreadsheetControl.UnitChanging and SpreadsheetControl.UnitChanged events fire when you use the SpreadsheetControl.Unit or ISpreadsheetComponent.Unit property to change the document's measurement unit. If you set the SpreadsheetControl.ReadOnly property for the control, the SpreadsheetControl.ReadOnlyChanged event occurs.

There are events that usually fire only for changes performed via the Spreadsheet control's UI: SpreadsheetControl.ActiveSheetChanged,SpreadsheetControl.SelectionChanged, SpreadsheetControl.CellValueChanged, and so on. Set the WorkbookEventOptions.RaiseOnModificationsViaAPI property to true to raise these events when changes are made in code.

Is this topic helpful?​​​​​​​