The dialogs don't have an owner, thus they behave unexpected and can be easily lost from the user and block the UI. This applies to many of the RadWindow.Alert() invocations in the UI of RichTextBox.
A document contains a field in result mode different that the one specified in the export settings in the format providers (i.e. a field that need to be updated during the export), and this field is in a header/footer, and another header/footer contains a table with AutoFit to Window size. When this document is exported to docx or RTF, the table is exported with 0 width. The table is visualized splashed in RadRichTextBox, and MS Word behaves strangely and/or doesn't visualize the table at all. The bug is regression in 2018 R1. Workaround 1: Change the result mode of all fields in the headers/footers to match the one set in format provider export settings (Result by default) just prior the export. Workaround 2: Set DocxFormatProvider.ExportSettings.FieldResultMode to null. For the default format provider used from the default Save command, use the following: ((DocxFormatProvider)DocumentFormatProvidersManager.GetProviderByExtension("docx")).ExportSettings = new DocxExportSettings() { FieldResultMode = null }; Fix available in LIB Version 2018.2.723.
Currently, paragraphs that have applied a list style but their list level is set to -1 or another invalid value, cannot be imported due to an ArgumentOutOfRangeException. According to the specification, the scenario is invalid, though, in MS Word and WordPad, similar values are not respected.
Paragraph spacing from table style is not exported for each paragraph inside the table. The table style defines paragraph properties which should be respected when exporting the styles to HTML. Workaround: Apply the paragraph settings coming from the table style directly to the elements.foreach
(var table
in
radRichTextBox.Document.EnumerateChildrenOfType<Table>())
{
foreach
(var paragraph
in
table.EnumerateChildrenOfType<Paragraph>())
{
paragraph.LineSpacing = table.Style.ParagraphProperties.LineSpacing;
paragraph.LineSpacingType = table.Style.ParagraphProperties.LineSpacingType;
paragraph.AutomaticSpacingAfter= table.Style.ParagraphProperties.AutomaticSpacingAfter;
paragraph.AutomaticSpacingBefore = table.Style.ParagraphProperties.AutomaticSpacingBefore;
paragraph.SpacingAfter = table.Style.ParagraphProperties.SpacingAfter;
paragraph.SpacingBefore = table.Style.ParagraphProperties.SpacingBefore;
}
}
When the position on which the users right-click is an annotation start or end marker, the context menu doesn't provide suggestions about spellcheck errors. Steps to reproduce: 1. Type "The greater the better" in RadRichTextBox with enabled spellchecking 2. Turn on track changes 3. Move the caret to the 't' of "greater" 4. Insert 't' so the word becomes wrong 5. Right-click on the 't' letter inserted in step 4 Observed: The context menu doesn't show suggestions for fixing the misspelled word Expected: The context menu should suggest a fix
- Localization for "Simple text" in the Define New List Style dialog and Define New Style dialog at RadRichTextBox. - Levels (from 1st to 9th) are hardcoded in dialog's code behind and cannot be localized. (these are the items in the 'Apply Formatting to' comboBox)
The "Text Wrapping" string, used in the FloatingBlockPropertiesDialog lacks translations in Spanish and French. In the English and Turkish values, a space is missing between the words. Fix available in LIB Version 2018.1.416.
When pasting a big image in RichTextBox, it is pasted with its original size. It should be resized so it can fit on the page. Similar logic is available in the InsertPictureCommand. Workaround: private void RadRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e) { if (!(e.Command is PasteCommand)) { return; } DocumentFragment res = ClipboardEx.GetDocumentFromClipboard("RadDocumentGUID"); if (res == null) { foreach (ClipboardHandler settings in ClipboardEx.ClipboardHandlers) { res = ClipboardEx.GetDocumentFromClipboard(settings.ClipboardDataFormat, settings.ClipboardStringFilter); } } if (res == null) { e.Cancel = true; var bitmapSource = Clipboard.GetImage(); if (bitmapSource == null) { return; } Padding sectionmargin = this.radRichTextBox.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection.ActualPageMargin; double originalPixelWidth = bitmapSource.Width; double originalPixelHeight = bitmapSource.Height; if (originalPixelWidth == 0 || originalPixelHeight == 0) { originalPixelWidth = 10; originalPixelHeight = 10; } double width = originalPixelWidth; double height = originalPixelHeight; if (this.radRichTextBox.Document.LayoutMode == DocumentLayoutMode.Paged) { Section currentSection = this.radRichTextBox.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection; var pageSize = (SizeF) currentSection.GetType().GetProperty("ActualPageSize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(currentSection, null); double maxWidth = pageSize.Width - (sectionmargin.Left + sectionmargin.Right); double maxHeight = pageSize.Height - (sectionmargin.Top + sectionmargin.Bottom); width = Math.Min(maxWidth, width); height = Math.Min(maxHeight, height); } double ratio = originalPixelWidth / originalPixelHeight; width = Math.Min(width, height * ratio); height = width / ratio; Size size = new Size(width, height); ImageInline imageInline = new ImageInline(new WriteableBitmap(bitmapSource)); imageInline.Size = size; this.radRichTextBox.ActiveDocumentEditor.InsertInline(imageInline); } }
There are a number of Bitmap objects that are not disposed. Changing this behavior could improve the memory usage when exporting PDF documents.
Having a table with specified RowSpan and further exported to PDF does not draw the border. This is due to export optimization caused by the fact whether there is or is not a CellSpacing specified. Workaround: Set really small CellSpacing for the table.
Currently, RadRichTextBox only imports from HTML documents tables with spacing between cells, but it does not export tables with such style. It seems like the border-collapse: collapse value defined in the Table Normal style overrides the border-spacing value, which is applied to the cells. As a workaround, the document styles can be omitted from the exported HTML and the styling can be exported inline be changing the ExportSettings of HtmlFormatProvider: provider.ExportSettings.StylesExportMode = StylesExportMode.Inline; provider.ExportSettings.StyleRepositoryExportMode = StyleRepositoryExportMode.DontExportStyles;
The caret gets a wrong size when positioned on annotation start/end.
The custom list styles from a document exported by RadRichTextBox's HtmlFormatProvider are not imported.
Loading large documents freezes the UI. Instead, the document could be imported and measured asynchronously in a background thread, and some progress indicator shown to the user.
Note: Image sources should be frozen when the document is loaded in a background thread.
Workaround: Following the steps:
- Import the document in a background thread using the specific format provider.
- Freeze all images in the document using the methods in the attached file.
- Set the document to RadRichTextBox in the main thread using a dispatcher: this.Dispatcher.Invoke(new Action(() => { this.radRichTextBox.Document = document; }));
Switching between bulleted and numbered lists only affects current paragraph instead of changing the list for all paragraphs currently included in it. Steps to reproduce 1. Create a numbered list with several items 2. Click the bulleted list button Expected behavior: The entire list switches from numbered to bulleted Actual behavior: The current list item switches to bulleted but the rest of the list remains numbered. Workaround: When the ToggleBulletsCommand is executed, traverse the PreviousSiblings and NextSiblings of the current paragraph and change their list properties if they belong to the same list. Sample code attached. Note: the workaround will change the list properties only for the consecutive paragraphs of the same list and will create a selection to do so.
The field result shows the number of pages the current section contains.
When the users select a table using the thumb provided by the TableAdorner, the table is selected but the Table Tools contextual tab in RadRichTextBoxRibbonUI is not activated. Workaround: Attach to SelectionChanged and move the caret position to the first position of the table when the selection range is only one and is of type Table. Sample code is attached.
Some of the methods in RadDocumentEditor/RadRichTextBox call RadDocument.EnsureDocumentMeasuredAndArranged(), but some don't, for example: - InsertAnnotationRange - InsertLine - ChangeAllFieldsDisplayMode This causes exceptions or incorrect behavior what layout is not performed on the document. Workaround: Call EnsureDocumentMeasuredAndArranged before the problematic methods.
If the empty run is defined with start-tag and end-tag the import is correct: <w:p> <w:r></w:r> </w:p> However, if it is defined with empty-element tag, its parent Paragraph is not imported: <w:p> <w:r/> </w:p> Fix available in R2 2018 SP1 release version.
When the document uses a font that cannot be found on the machine, it is substituted for another font. What should happen is to fall back to another font for the visualization, but to preserve the original font in the model. Partial workaround: for HTML import, the font can be preserved by subscribing to the FontSubstituting event: provider.ImportSettings.FontSubstituting += ImportSettings_FontSubstituting; private void ImportSettings_FontSubstituting(object sender, FontSubstitutingEventArgs e) { e.SubstitutionFontFamily = new FontFamily(e.OriginalFontName); }