Cell Edit

A cell can enter editing mode if user double-clicked on cell (by default), or press F2 on control. A text-box will be placed on the control for receipting user's input.

An input form sample:

Check Editing Cell

Method IsEditing used to check whether any cells is in editing mode of the control.
bool result = grid.IsEditing;
And method GetEditingCell can be used to get the position of editing cell:
ReoGridCell cell = grid.GetEditingCell();

Control in edit

Start edit

Method StartEdit used to start an edit operation on specified cell.
grid.StartEdit(int row, int col);
grid.StartEdit(ReoGridPos pos);
If currently any cell is in editing, the editing will be finished automatically.

Force to end edit

Method EndEdit can force current editing stop. There is a flag named ReoGridEndEditReason used to notify the control whether should to abort current edit operation.
EndEdit(ReoGridEndEditReason reason);
EndEdit method has also an argument used to fill the data instead of user's input.
EndEdit(object data)
EndEdit(object data, ReoGridEndEditReason reason)

Prevent cell to start edit

Bind BeforeCellEdit event and set its IsCancelled to false can prevent cell enter editing mode.
grid.BeforeCellEdit += (s, e) => e.IsCancelled = true;

Readonly cell

Property readonly for cell instance used to disable changing the data of cell, cell editing will be disabled if focus cell is read-only, and paste operation will be aborted if target range including a read-only cell.
This feature to be available in v0.8.6
var cell = grid.CreateAndGetCell("A1");
cell.Readonly = true;

Next: Merge and Unmerge

Last edited Feb 5, 2014 at 2:12 PM by unvell, version 6