Workbook Events
Event | When |
---|---|
WorksheetCreated | When new worksheet instance has been created |
WorksheetInserted | When worksheet has been inserted into workbook |
WorksheetRemoved | When worksheet has been removed from workbook |
BeforeWorksheetNameChange | Before name of worksheet change, set IsCancelled property can abort this operation |
WorksheetNameChanged | When name of worksheet has been changed |
SettingsChanged | When any settings of workbook has been changed |
ExceptionHappened | When any internal exception happen from any worksheet |
Action Events
Event | When |
---|---|
ActionPerformed | When any actions have been performed |
Undid | When undid action |
Redid | When redid action |
Worksheet Events
Worksheet events available for worksheet instances. To get an instance of worksheet, use the CurrentWorksheet
or Worksheets[index]
property of workbook (grid control). See Worksheet.
Cell Events
Event | When |
---|---|
BeforeCellEdit | Before any cells to be changed to edit mode |
AfterCellEdit | When any cells have been edited by user |
CellDataChanged | When data of cell have been changed |
CellMouseEnter | When mouse moved into a cell, the cell will be hovered |
CellMouseLeave | When mouse leaved from a hovered cell |
CellMouseDown | When mouse button pressed inside a cell |
CellMouseUp | When mouse button released inside a cell |
CellMouseMove | When mouse moving inside a cell |
About the cell edit events see cell edit.
Keyboard Events
Event | When |
---|---|
BeforeCellKeyDown | When user pressed any key on worksheet (before native behaviors) |
AfterCellKeyDown | When user pressed any key on worksheet (after native behaviors) |
CellKeyUp | When user released any key on worksheet |
Rows and Columns Events
Event | When |
---|---|
RowInserted | When user inserted rows |
RowDeleted | When user deleted rows |
ColInserted | When user inserted columns |
ColDeleted | When user deleted columns |
RowsHeightChanged | When rows height changed |
ColumnsWidthChanged | When columns width changed |
RowFiltered | When rows applied filter |
RowSorted | When rows sorted |
Range Events
Event | When |
---|---|
RangeDataChanged | When data update opeartions to a range performed |
RangeMerged | When range merged |
RangeUnmerged | When range unmerged |
RangeStyleChanged | When styles have been set |
BeforeRangeCopy | Before selected range will be copied |
BeforeRangeMove | Before selected range will be moved |
AfterRangeCopy | After range copy operation |
AfterRangeMove | After range move operation |
Border Events
Event | When |
---|---|
BorderAdded | When borders have been set |
BorderRemoved | When borders have been removed |
Selection Events
Event | When |
---|---|
SelectionRangeChanged | After selection range changed |
SelectionRangeChanging | Fired during selection changing by mouse |
SelectionModeChanged | When selection mode changed |
SelectionStyleChanged | When selection style changed |
SelectionForwardDirectionChanged | When selection forwarding direction changed |
SelectionMovedForward | When selection will be moved into next position |
HoverPosChanged | When mouse move over on cells |
FocusPosChanged | When focused cell changed |
Learn more about Selection.
Outline Events
Event | When |
---|---|
OutlineAdded | When an outline has been added onto the spreadsheet |
OutlineRemoved | When an outline has been removed from the spreadsheet |
BeforeOutlineCollapse | When user clicked on the - button of an outline to collapse it |
AfterOutlineCollapse | When an outline has been collapsed |
BeforeOutlineExpand | When user clicked on the + button of an outline to expand it |
AfterOutlineExpand | When an outline has been expanded |
For usage of outline events, see Group & Outline.
Freeze Events
Event | When |
---|---|
CellsFrozen | When worksheet has been frozen |
CellsUnfrozen | When worksheet has been unfrozen |
Learn more about freeze, see freeze.
Generic Events
Event | When |
---|---|
Scaled | When control scaled (zoom in/out) |
FileLoaded | When content of control loaded from a file stream (load from given stream will not fire this event) |
FileSaved | When content of control have been saved into file stream (save into given stream will not fire this event) |
Resetted | When control has been reset to default status |
Clipboard Events
Event | When |
---|---|
BeforeCopy | Before doing copy operation |
AfterCopy | When range copied from Clipboard |
BeforePaste | Before doing paste operation |
AfterPaste | When range pasted from Clipboard |
BeforeCut | Before doing cut operation |
AfterCut | When range cut by user |
OnPasteError | When errors happened during paste operation |
Examples
Set editable range by handling event
Many before-event provided by ReoGrid have the property IsCancelled, which can be set as true to notify Control to cancel the following operations. It typically to be used to prevent the cell-edit or outline-collapse/expand operations.
For example, to only allow the text editing inside specified range:
// select a worksheet
var sheet = grid.CurrentWorksheet;
// create a range define
var editableRange = new RangePosition(3,1,2,3);
// set borders to range
sheet.SetRangeBorder(editableRange, BorderPositions.Outside, RangeBorderStyle.BlackSolid);
// set text and handle events
sheet[2, 1] = "Edit only be allowed in this range:";
sheet.BeforeCellEdit += (s, e) => e.IsCancelled = !editableRange.Contains(e.Cell.GetPos());