When you copy from outside the grid into the grid, the default behavior is to copy Text. This is what is happening with Excel. In this case, you can control whether ReadOnly cells get pasted, skipped or cause the operation to stop using the PasteCellText event.
private void gridControl1_PasteCellText(object sender, GridPasteCellTextEventArgs e)
{
if(e.Style.ReadOnly)
{
e.Cancel = true; //skip the paste on this one cell
//e.Abort = true; //abort all further pastes
}
}
When you copy and paste from within the grid, then default behavior is to paste GridStyleInfo objects. When this is done, there is no event fired on a cell by cell basis that would allow you to easily decide whether or not to paste ReadOnly cells. One way to get around this (if you do not want to copy/paste styles) is to turn off the styles support, and then you are back in the position of only pasting text like in the first case. And you can use PasteCellText to manage the behavior of ReadOnly cells. To turn off style copy/paste support, use code like:
this.gridControl1.Model.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles;