RadRichTextBox - Undo command does not work if you insert text through Insert method.
Code to reproduce:
radRichTextBox1.Document.Insert("Inserted text", radRichTextBox1.CurrentEditingStyle);
Work around:
1.Insert text char by char through InputBehavior.ProcessKeyPress method:
string text = "Inserted text";
foreach (char ch in text)
{ radRichTextBox1.RichTextBoxElementrElement.DocumentView.InputBehavior.ProcessKeyPress(new KeyPressEventArgs(ch));
}
Resolution:
This issue is addressed in the new version of the control - RadRichTextEditor. Please use the new control instead the RadRichTextBox.
When call Document.Insert method, still can not undo. To execute commands in an undo scope either use:
this.radRichTextEditor1.Commands.InsertTextCommand.Execute("some text", false);