The cell editor is not a WinForms TextBox: it draws its own caret and selection. It
shares the same layout code as the grid, so characters do not shift position between editing
and committing.
Starting and ending an edit
| Member | What it does |
|---|---|
control.BeginEdit(initialText) | Starts editing (null keeps the current value) |
control.CancelEdit() | Cancels and closes |
control.IsEditing | Whether an edit is in progress |
Typing or double-clicking starts one automatically. Enter or Tab commits; Esc cancels.
using unvell.ReoGrid.Avalonia;
using unvell.ReoGrid.Core;
grid.BeginEdit(null); // start editing from the current value; pass a string to replace it instead
bool editing = grid.IsEditing;
grid.CancelEdit(); // cancel and close
How typed input is interpreted
To set a value from “what the user typed”, use the dedicated API.
| Member | What it does |
|---|---|
control.GetActiveCellInput() | =-prefixed for a formula, the display string otherwise |
control.SetActiveCellInput(text) | Interprets the string and stores a value or a formula |
SetActiveCellInput interprets by Excel’s rules.
| Input | Result |
|---|---|
=SUM(A1:A2) | a formula (the leading = is stripped before storing) |
1234 | a number |
TRUE / FALSE | a boolean |
2026/07/28 | a date |
| anything else | text |
Use these two when building your own formula bar. The model’s SetFormula does not accept a
leading = (The Formula Engine).
// these two are what a hand-built formula bar needs; they parse by Excel's rules
string shown = grid.GetActiveCellInput(); // prefixed with "=" when it is a formula
grid.SetActiveCellInput("=SUM(A1:A2)"); // set as a formula
grid.SetActiveCellInput("1234"); // set as a number
grid.SetActiveCellInput("2026/07/28"); // set as a date
Formatted editing
Formatting can be changed per character while editing. It is saved as rich text when the edit is committed.
| Member |
|---|
control.ToggleEditingBold() |
control.ToggleEditingItalic() |
control.ToggleEditingUnderline() |
control.SetEditingTextColor(color) |
Wrapping and line breaks
Alt+Enter inserts a line break inside a cell.
When the cell has a TextWrapMode, the editor wraps at the
column width too. The break points come from exactly the same calculation the grid renderer
uses (kinsoku rules included), so the line breaks do not move when you commit. The editor
grows downwards.
In a cell with no wrap setting, the editor behaves as it always has: it grows sideways and stays on one line.
Home / End and the up/down arrows work on the visual line, so they move to the start
or end of the wrapped line you are on.
On commit, if the row is still on automatic sizing, its height is refitted to the content — growing with added line breaks and shrinking when they go away. A row whose height was set by hand keeps that height.
Japanese input (IME)
Both WinForms and WPF support IME.
- The composition string is displayed inside the cell
- Starting Japanese input on a cell that is not being edited opens the editor and continues the composition there
The Avalonia build relies on each platform’s own IME implementation.
Formula highlighting
While editing input that begins with =, the cells and ranges it references are
color-coded — the same behaviour as V4’s 4.6 line.
Preventing editing
A cell type returning AllowsTextEditing => false cannot be typed into (a checkbox, for
instance). See Custom Cell Types.
Without a license applied, editing is disabled on all three controls. Display, scrolling, printing and export all keep working (Applying a License Key).
History
Committing an edit records it in the history. Merely opening the editor without committing does not.