How to use

Three ways to call control:
  • Call methods of Control call methods of control directly like SetCellData.
  • Using Action Mechanism perform operations by doing action gives the ability to undo operations.
  • Run Script powerful macro and script execution like VBA in Excel can also change the behavior of control.
Action mechanism provides the ability to support Do/Undo/Redo/Repeat actions for lots of operations. All the operations that is raised from End-user are better to be performed by doing actions.

Call methods of control

Set data using index property of control:
grid["A1"] = "hello world";
grid[2, 1] = 10;
or call SetCellData method:
grid.SetCellData(new ReoGridPos(2,1), "hello world");

Using action mechanism

1. Import this namespace:
using unvell.ReoGrid.Actions;
2. Invoke 'DoAction' method of grid control, pass action as argument
grid.DoAction(new RGSetCellDataAction(new ReoGridPos(2,1), "hello world"));
To undo or redo last action:
To repeat doing last action and apply to another range:
grid.RepeatLastAction(new ReoGridRange(2, 3, 5, 5));

Run script

Make sure the modules that are used to support the Script Execution are all referenced to your project. see Install.

Import the namespace:
using unvell.ReoScript;
Run script:
string script = "grid.getCell(2,1).data = 'hello world';";
grid.RunScript("grid.getCell(2,1).data = 'hello world';");

Next: Cell

Last edited Feb 5, 2014 at 2:59 PM by unvell, version 22