I thought about Editable for rows so your code could be simplified to:
for (int row = 0; row < grid.GetRowCount(); ++row)
grid.GetRow(row).Editable(!readOnly);
This version is also faster.
Hello uno
Thanks for your fast response.
Unfortunately, these solution does not let to copy a cell in read only mode.
Other drawback is that it lets to follow editing a cell in read only mode if it was being edited previously. However Reject() is better as it ends any previous unfinished editing.