The package is unvell.ReoGrid.One.Wpf and the namespace is unvell.ReoGrid.Wpf.
Drawing goes through DrawingContext / FormattedText (WpfGraphics).
For getting started and sample code, see WPF Quick Start.
Structure
ReoGridControl derives from Panel. The grid itself is drawn in OnRender, and the
scrollbars, the cell editor and the dropdown ride on top as child elements.
Coordinate system
WPF’s DIP is based on 96 DPI, which matches the core’s logical pixel. There is therefore
no equivalent of the WinForms build’s DpiScale conversion, and per-monitor DPI is handled
by the framework.
Borders are drawn crisply thanks to EdgeMode.Aliased and SnapsToDevicePixels. Brushes,
pens and typefaces are frozen and cached.
Members
The same names and meanings as the WinForms build.
| Category | Members |
|---|---|
| Workbook | Workbook ActiveWorksheet SetWorksheet LoadWorkbook NewWorkbook LoadJson |
| Selection | Selection ActiveCell SelectionChanged |
| Editing | BeginEdit CancelEdit IsEditing SetActiveCellInput and more |
| History | Undo Redo CanUndo CanRedo HistoryChanged |
| Display | Zoom ZoomChanged SetFreeze |
| Events | WorkbookChanged ActiveSheetChanged ContextMenuRequested CellButtonClicked |
The bulk operations on a selection line up under the same names too (Selection and the Active Cell).
Printing
control.Print();
control.Print(new PrintSettings { /* ... */ });
It builds a DocumentPaginator internally and passes it to the print dialog. Where the
WinForms build returns a PrintDocument, the WPF build’s method does the printing.
Rendering to an arbitrary DrawingContext
control.RenderTo(drawingContext, width, height, pixelsPerDip);
Japanese input (IME)
The implementation reassociates the IMM32 context to receive WM_IME_* messages, matching
the WinForms build. Starting Japanese input on a cell that is not being edited opens the
editor in place.
Differences from the WinForms build
| WinForms | WPF | |
|---|---|---|
| Base class | Control | Panel |
| DPI conversion | applies DpiScale | none needed (DIP = logical pixel) |
| Zoom | multiplied into RenderScale | a ScaleTransform |
| Printing | returns a PrintDocument | Print() does it |
| Drawing target | System.Drawing.Graphics | DrawingContext |