Three things for the escape problem. One, set isModified to false in the ProcessKeyEventArgs override after cancelling the edit and before returning true.
this.CurrentCell.CancelEdit();
this.CurrentCell.IsModified = false;
return true;
Two, add a GetFormattedText override to the cell model class.
public override string GetFormattedText(GridStyleInfo style, object value, int textInfo)
{
rtb.Rtf = style.Text;
return rtb.Text;
}
Three, add a grid.CurrentCellRejectedChanges event handler to your form code, and explcitly set the GridAwareTextBox value there.
private void gridControl1_CurrentCellRejectedChanges(object sender, EventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
this.gridAwareTextBox1.Text = this.gridControl1[cc.RowIndex, cc.ColIndex].FormattedText;
}
Before you try to autosize the cell, try calling grid.CurrentCell.EndEdit to see if that makes things work OK. If not, can you explain how you are trying to autosize the cell (say for a menu item or are youtrying to do it dynamically woith each keystroke or ???)? Can you post a sample showing the problem?