ReoGrid
DOCUMENT
Events

Workbook Events

EventWhen
WorksheetCreatedWhen new worksheet instance has been created
WorksheetInsertedWhen worksheet has been inserted into workbook
WorksheetRemovedWhen worksheet has been removed from workbook
BeforeWorksheetNameChangeBefore name of worksheet change, set IsCancelled property can abort this operation
WorksheetNameChangedWhen name of worksheet has been changed
SettingsChangedWhen any settings of workbook has been changed
ExceptionHappenedWhen any internal exception happen from any worksheet

Action Events

EventWhen
ActionPerformedWhen any actions have been performed
UndidWhen undid action
RedidWhen 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

EventWhen
BeforeCellEditBefore any cells to be changed to edit mode
AfterCellEditWhen any cells have been edited by user
CellDataChangedWhen data of cell have been changed
CellMouseEnterWhen mouse moved into a cell, the cell will be hovered
CellMouseLeaveWhen mouse leaved from a hovered cell
CellMouseDownWhen mouse button pressed inside a cell
CellMouseUpWhen mouse button released inside a cell
CellMouseMoveWhen mouse moving inside a cell

About the cell edit events see cell edit.

Keyboard Events

EventWhen
BeforeCellKeyDownWhen user pressed any key on worksheet (before native behaviors)
AfterCellKeyDownWhen user pressed any key on worksheet (after native behaviors)
CellKeyUpWhen user released any key on worksheet

Rows and Columns Events

EventWhen
RowInsertedWhen user inserted rows
RowDeletedWhen user deleted rows
ColInsertedWhen user inserted columns
ColDeletedWhen user deleted columns
RowsHeightChangedWhen rows height changed
ColumnsWidthChangedWhen columns width changed
RowFilteredWhen rows applied filter
RowSortedWhen rows sorted

Range Events

EventWhen
RangeDataChangedWhen data update opeartions to a range performed
RangeMergedWhen range merged
RangeUnmergedWhen range unmerged
RangeStyleChangedWhen styles have been set
BeforeRangeCopyBefore selected range will be copied
BeforeRangeMoveBefore selected range will be moved
AfterRangeCopyAfter range copy operation
AfterRangeMoveAfter range move operation

Border Events

EventWhen
BorderAddedWhen borders have been set
BorderRemovedWhen borders have been removed

Selection Events

EventWhen
SelectionRangeChangedAfter selection range changed
SelectionRangeChangingFired during selection changing by mouse
SelectionModeChangedWhen selection mode changed
SelectionStyleChangedWhen selection style changed
SelectionForwardDirectionChangedWhen selection forwarding direction changed
SelectionMovedForwardWhen selection will be moved into next position
HoverPosChangedWhen mouse move over on cells
FocusPosChangedWhen focused cell changed

Learn more about Selection.

Outline Events

EventWhen
OutlineAddedWhen an outline has been added onto the spreadsheet
OutlineRemovedWhen an outline has been removed from the spreadsheet
BeforeOutlineCollapseWhen user clicked on the - button of an outline to collapse it
AfterOutlineCollapseWhen an outline has been collapsed
BeforeOutlineExpandWhen user clicked on the + button of an outline to expand it
AfterOutlineExpandWhen an outline has been expanded

For usage of outline events, see Group & Outline.

Freeze Events

EventWhen
CellsFrozenWhen worksheet has been frozen
CellsUnfrozenWhen worksheet has been unfrozen

Learn more about freeze, see freeze.

Generic Events

EventWhen
ScaledWhen control scaled (zoom in/out)
FileLoadedWhen content of control loaded from a file stream (load from given stream will not fire this event)
FileSavedWhen content of control have been saved into file stream (save into given stream will not fire this event)
ResettedWhen control has been reset to default status

Clipboard Events

EventWhen
BeforeCopyBefore doing copy operation
AfterCopyWhen range copied from Clipboard
BeforePasteBefore doing paste operation
AfterPasteWhen range pasted from Clipboard
BeforeCutBefore doing cut operation
AfterCutWhen range cut by user
OnPasteErrorWhen 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());

41


Was the content of the page helpful?

© 2012-2024UNVELL Inc.