ReoGrid
DOCUMENT
Handle Mouse Events

Cell Key Down

This event will be raised if mouse pressed down inside a visible cell.

Note that the Cell property of the event argument may be null. ReoGrid does not create any instances for cell if there was no data or styles set into the cell.

To make always getting a non-null cell instance, use the CreateAndGetCell method of worksheet instead of getting instance from event argument:

Attach event:

var sheet = grid.CurrentWorksheet;
sheet.CellMouseDown += sheet_CellMouseDown;

Event handler body:

void sheet_CellMouseDown(object sender, CellMouseEventArgs e)
{
  // unsafe: cell instance may be null
  var cell = e.Cell;

  // safe: cell instance created from position if not existed
  var sheet = grid.CurrentWorksheet;
  var cell = sheet.CreateAndGetCell(e.CellPosition);
}

Was the content of the page helpful?

© 2012-2024UNVELL Inc.