This is the code that forces the text to be replaced in an active cell.
if(this.gridControl1.CurrentCell.IsEditing)
this.gridControl1.CurrentCell.CancelEdit();
If you want to paste the text into an editing currentcell, the get the GridTextBoxControl from the cellrenderer, and set the text there.
if(rangeList.ActiveRange.IsCells)
{
int row = rangeList.ActiveRange.Top;
int col = rangeList.ActiveRange.Left;
s = s.Replace("", "");
s = s.Replace("\r", "");
if(this.gridControl1.CurrentCell.IsEditing)
{
GridTextBoxControl tb = this.gridControl1.CurrentCell.Renderer.Control
as GridTextBoxControl;
if(tb != null)
tb.Text = tb.Text.Substring(0, tb.SelectionStart)
+ s
+ tb.Text.Substring(0, tb.SelectionStart + tb.SelectionLength );
}
else
{
this.gridControl1[row, col].Text = s;
}
e.Handled = true;
e.Result = true;
}