Hi Daniel,
I am sorry to hear about the inconvenience this issue is causing you. I agree with you that this behavior needs to be fixed but at this point, a fix is still not available. The team is doing their best to fix issues in the control but since this one is not planned, I cannot say a specific time frame when this one can be fixed.
What I can suggest working around the issue with the current version is to intercept the paste operation and insert the block from the document one ny one:
private void RadRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is PasteCommand)
{
e.Cancel = true;
this.radRichTextBox.CommandExecuting -= this.RadRichTextBox_CommandExecuting;
RadDocument documentFromClipboard = ClipboardEx.GetDocument().ToDocument();
RadDocumentEditor editor = new RadDocumentEditor(documentFromClipboard);
DocumentPosition pos = new DocumentPosition(documentFromClipboard);
foreach (var block in documentFromClipboard.Sections.First.Blocks)
{
documentFromClipboard.Selection.Clear();
pos.MoveToDocumentElementStart(block);
documentFromClipboard.Selection.AddSelectionStart(pos);
pos.MoveToDocumentElementEnd(block);
documentFromClipboard.Selection.AddSelectionEnd(pos);
if (!documentFromClipboard.Selection.IsEmpty)
{
editor.Copy();
this.radRichTextBox.Paste();
}
}
this.radRichTextBox.CommandExecuting += this.RadRichTextBox_CommandExecuting;
}
}
Hope this will fit your needs.
Regards,
Tanya
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.