The start and end annotations are pasted along with the other content, trying to update the styles leads to cycle and StackOverflowException is thrown.
Workaround: Remove the comments from the document in the clipboard:
void radRichTextBox_ActiveDocumentEditorChanged(object sender, Telerik.Windows.Documents.UI.ActiveDocumentEditorChangedEventArgs e)
{
if (e.DocumentEditorType == Telerik.Windows.Documents.UI.DocumentEditorType.Comment)
{
var currentEditor = this.radRichTextBox.ActiveDocumentEditor as RadRichTextBox;
currentEditor.CommandExecuting += activeEditor_CommandExecuting;
}
}
void activeEditor_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
if (e.Command is PasteCommand)
{
RadDocument pastedDocument = ClipboardEx.GetDocument().ToDocument();
RadDocumentEditor editor = new RadDocumentEditor(pastedDocument);
editor.DeleteAllComments();
ClipboardEx.SetDocument(new DocumentFragment(pastedDocument));
}
}
Placing a floating image after the end of the last paragraph in a page and switching to Flow layout mode will result in missing an image. The image is actually there, but it is not in the viewport.
This includes resizing, rotating and moving. Consider implementing the full functionality for interaction with both floating and inline images.
When text with Code 128 font is rendered in RadRichTextBox, there are some unexpected behaviours: - Spaces are not rendered (they have special representation in Code 128). This issue will be reproduced for all fonts which define special (non-empty) representation of the space character. - During rendering, UI inserts "Left-to-Right Mark" character and "Right-to-Left Mark" character, which are not defined in the font and appear as .notdef glyph, which is white rectangle. This issue will be reproduced for all fonts which do not define these characters.
When the document contains headings with heading styles associated with numbering styles (numbered headings), and TOC field is inserted and/or updated in the document, the TOC items should contain the numbering which comes from the style. Instead, on update the numbering is lost and only heading text is included in the field result.
Provide option for exporting InlineUIContainer and FloatingUIContainer as images to docx and RTF format.
When exporting with RtfFormatProvider (including when the users copy content), an additional \par tag is added at the end of the document.
Workaround: Process the RTF after it is generated.
Here is an example how to achieve it when copying:
this.radRichTextBox.CommandExecuted += radRichTextBox_CommandExecuted;
...
void radRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
if (e.Command is CopyCommand)
{
DocumentPosition end = this.radRichTextBox.Document.Selection.Ranges.Last.EndPosition;
RadDocument clipboardDocument = ClipboardEx.GetDocument().ToDocument();
RtfFormatProvider provider = new RtfFormatProvider();
string rtfString = provider.Export(clipboardDocument);
int indexLastParOpening = rtfString.LastIndexOf("{");
int indexLastParClosing = rtfString.IndexOf('}', indexLastParOpening);
string newRtf = rtfString.Remove(indexLastParOpening, indexLastParClosing - indexLastParOpening + 1);
Clipboard.SetData("Rich Text Format", newRtf);
}
}
Currently, working with bookmarks and cross references in the headers and footers of a document is not supported.
When there isn't space for the first non-repeated row to be drawn on the page, the repeated rows should not be repeated on each page where the table spans - they should be drawn only on the first page (the page where the table begins). However, currently the requirement described above is not satisfied and the first repeated row is drawn on every page, where the table spans, which is not correct according to the Office Open XML specification.
Create document with some text. Insert image. Right click on image and add hyperlink to it. Drag the image somewhere in the text. Observe that it is created a copy of the image. Actually, the issue occurs when the hyperlink is inserted.
Implement generating of an image and inserting it into the clipboard on copy/cut so it can be pasted in MS Paint or other tools for image editing. Attaching to the CommandExecuting event of RadRichTextBox and handling the copy command can be used as a workaround:CopyCommand command = e.CommandasCopyCommand;if(command !=null){ImageInline image =this.radRichTextBox.Document.Selection.GetSelectedSingleInline()asImageInline;if(image !=null){Clipboard.SetImage(image.ImageSource);e.Cancel =true;}}
Steps to reproduce: Create a new blank document. Write some text. Use "Enter" key to create some empty lines, until new page is created. Print to a real printer or to pdf file using tools like PDFCreator or Bullzip. Actual result: Nothing is printed. Expected result: Two pages should be printed. Workaround: Add an empty character in the footer.
When the users move the image (evaluated as a result of the field) using the document selection, the field is removed from the document and the image is duplicated.
The following HTML should generate a table with width of 600px: <table width="25px" border="1px solid black"> <tr> <td> <table width="600"> <tbody> <tr><td >Test</td></tr> </tbody> </table> </td> </tr> </table> When the same html is imported in RadRichTextBox, the table is 25px wide.
Currently the API allows ClipboardHandler-s to be registered in ClipboardEx.ClipboardHandlers collection, which is used when content is pasted.
We can extend ClipboardHandler with property describing whether the handler is supported for copy, paste, or copy&paste, and use the collection for copy operation as well.
Workaround: Use RadRichTextBox.CommandExecuted and on copy, enhance the original data object in the clipboard:
this.radRichTextBox.CommandExecuted += (sender, e) =>
{
if (e.Command is CopyCommand)
{
var originalDataObject = Clipboard.GetDataObject();
DataObject dataObject = new DataObject();
foreach (string format in originalDataObject.GetFormats())
{
dataObject.SetData(format, originalDataObject.GetData(format));
}
dataObject.SetData("Html", new HtmlFormatProvider().Export(this.radRichTextBox.Document));
Clipboard.SetDataObject(dataObject);
}
};
ContextMenu holds a reference to last RadRichTextBox it's shown for. Since ContextMenu is cached by MEF, this leads to memory leak.
Workaround: There are two options:
- manually set different instances of ContextMenu to all your RadRichTextBox-es
this.radRichTextBox.ContextMenu = new Telerik.Windows.Controls.RichTextBoxUI.ContextMenu();
- Create custom context menu that will be non-sharable. MEF will automatically load different instances of it for all RadRichTextBoxes on demand:
[PartCreationPolicy(CreationPolicy.NonShared)]
[CustomContextMenu]
public class NonSharedContextMenu : ContextMenu
{
}
Using any of the options will prevent MEF from creating cached instance of the ContextMenu.
For some font sizes, the end of the last letter or the start of first letter is clipped. The problem is most visible with italic styles and large font sizes, but is present even for small sizes and regular style.
The settings of the empty paragraphs in the document fallback to the default document settings (Verdana). The EnumerateChilderOfType() method can be used to traverse all the paragraphs in the document and apply them the same font family as a workaround.
The dialog should match the strings contained in the different document parts (headers, footers, footnotes, endnotes, comments).