Completed
Last Updated: 28 Nov 2014 05:59 by ADMIN
ADMIN
Anton
Created on: 06 May 2013 07:47
Category:
Type: Bug Report
6
FIX. RadRichTextBox - Undo command does not work if you insert text through Insert method.
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);
0 comments