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 event flow.
Keyboard Events
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());
Do you have an event “after column resize”?
Current there is no event for columns and rows resizing. But it is able to use ActionPerformed event to monitor all actions from end-user. When end-user changes the column width an instance of SetColumnsWidthAction class will be passed to the handler of ActionPerformed event.
Do you have an event “cell selected”?
You could check the
SelectionRangeChanged
orFocusPosChanged
event.sorry I do not know how to setup to get the range event (grid event is OK). Do you have an example?
I do not have all the events, for example
CellMouseDown
. Is it due to the fact I have the 8.8 version?There is no 8.8 version. Right click on ReoGrid.dll and select “Properties” to check what version you are using. Some events actually not available in old versions.
0.8.8.4 Version
no cell events if I look at the properties of the grid
CellMouseDown
event is worksheet event so you may need to get an instance of worksheet by using likereoGridControl.CurrentWorksheet
method firstly.Sorry for a long thread comment but post questions in http://forum.reogrid.net will be helpful.
there is one big issue that I have been struggling with for the past 5 days.
I want to update both formula and data at the same time, but whenever I update one an event is raised to erase the other one.
I cannot have both formula and data assigned to a cell which is a big BUG.
We need your detailed information to confirm that bug, could you please post some code or pictures in http://forum.reogrid.net to describe how you used it and what problems you faced. Thanks!
Thanks for the whole API, but there is one major event is missing which is AfterRangeKeyDown if it can be added it would be great and cause me less headache.
You could use
AfterCellKeyDown
event and checkFocusPos
property for ranges position.Hello Jing
Do you have an event “after a filter action”?
Currently no event for this. A new event will be added from 1.1 version. Thanks.
Thank you, so I looked forward to version 1.1
The version 1.1 has been released and you could download it from: https://reogrid.net/download.
The event name is
RowsFiltered
, to check whether or not a row has been hidden or shown, useIsRowVisible(int)
method to check whether or not the row is visible. Invisible rows means they have been collapsed.How can I cancel the copy made by draging the lower right conor of the selection range? I tried brforeRangeCopy event and it does not fire.
And how to cancel or monitor the data deleted by pressing delete key on the keyboard?