Popups (ImageMiniToolBar and SelectionMiniToolBar) stay on most top (act as if "Always on Top" is set to them) even if they had lost focus.
Workaround: Attach to LostFocus or LostKeyboardFocus events and hide the toolbar in the handler:
this.radRichTextBox.LostFocus += (sender, e) =>
{
this.radRichTextBox.SelectionMiniToolBar.Hide();
this.radRichTextBox.ImageMiniToolBar.Hide();
};
When paragraph is in list, the user can choose "Set Numbering Value" which will change the appropriate level Starting Index and will create a new list (or continue the previous one).
The display mode of all fields is changed to Code, so that the export could work correctly and nested fields would be persisted. Consider optimizing the algorithm, so that fields take less time to be exported.
Import the type of the <ul> and <ol> tag, e.g. <ul type="disc"> or <ul type=circle>. Supported values are disc, circle, square.
Depending on the current layout of the document, invoking SetPosition() for a specific location might result in positioning the caret on the line prior to the expected one.
Steps to reproduce:
radRichTextBox.Insert("one: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("two: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("tree: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("four: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("five: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("seks: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("seven: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("eitgh: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("nine: ");
radRichTextBox.Insert(Environment.NewLine);
radRichTextBox.Insert("ten: ");
radRichTextBox.Document.CaretPosition.SetPosition(radRichTextBox.Document.CaretPosition.Location); radRichTextBox.Focus();
Observed: The caret is positioned after "eitgh:"
Expected: The caret shouldn't change its position
Add adorners for selecting table rows, table columns and table cells with single click, similar to the ones in MS Word
Currently <big> and <small> tags are not supported and the text inside is not imported.
All Microsoft Office applications (Outlook, Exchange, Word, Excel) that can produce HTML are creating them with all of the CSS stylings commented with HTML comment, as follows: <style><!-- CSS --></style> This is a problem as RadRichTextBox's HTML parser does not import the CSS when it is commented like that. Workaround: Remove the HTML comment from the CSS style tag.
Introduce Split Table Command.
In MS Word, the command is in Table Tools -> Layout -> Merge -> Split table.
Workaround: Use the RadDocumentEditor API to split the table:
var tableRowBox = this.radRichTextBox.Document.CaretPosition.GetCurrentTableRowBox();
if (tableRowBox != null)
{
this.radRichTextBox.BeginUndoGroup();
this.radRichTextBox.Document.Selection.Clear();
var currentRow = tableRowBox.AssociatedTableRow;
DocumentPosition start = new DocumentPosition(currentRow.GetRootDocument());
start.MoveToStartOfDocumentElement(currentRow);
DocumentPosition end = new DocumentPosition(start);
end.MoveToEndOfDocumentElement(currentRow.Table.Rows.Last);
this.radRichTextBox.Document.Selection.SetSelectionStart(start);
this.radRichTextBox.Document.Selection.AddSelectionEnd(end);
this.radRichTextBox.Cut();
this.radRichTextBox.InsertParagraph();
this.radRichTextBox.Paste();
this.radRichTextBox.EndUndoGroup("Split table");
}
Japanese users use distributed text alignment, which justifies all lines including the last one.
When trying to import a document containing bookmark and BookmarkRangeEnd is after the last paragraph, a StackOverflowException is thrown in IntervalNode while trying to rebuild the document cache. (RadDocumentChildrenCache.RebuildTree()). The same could be observed if the bookmark end is last in the header/footer, between table cells in the RadDocument body, or when all paragraphs after the bookmark range end are hidden (with vanish property). Workaround: Detect the problematic annotations and remove them: foreach (var rangeStart in document.EnumerateChildrenOfType<AnnotationRangeStart>()) { if (rangeStart.End == null || rangeStart.End.Parent == null || rangeStart.End.Parent.Parent == null) { //MessageBox.Show("This indicates a problem."); rangeStart.Parent.Children.Remove(rangeStart); } } Note: Until 2017 R2 SP1 release StackOverflowException is thrown, after this release an ArgumentException should be thrown.
The content of a page can be aligned vertically. In DOCX, this is a property of the section and is defined with the vAlign element. <w:sectPr> … <w:vAlign w:val="center" /> </w:sectPr>
When image watermark is set and its height is configured through DocumentWatermarkSettings.ImageSettings.Size.Height, the height is not respected. Steps to reproduce: 1. Insert a Watermark with size var watermarkSettings = new DocumentWatermarkSettings() { Type = WatermarkType.ImageWatermark, ImageSettings = new WatermarkImageSettings() { UriSource = new Uri("c:\1.jpg"), Size = new Size(200, 300) } }; Expected: The image is with the specified width and height. Actual: The height is different.
At the moment the table properties, including table, table row and table cell properties don't have size validation, i.e. it is possible to set them to negative or zero values. Validation should be added where necessary.
When a span or text is placed in <a> tag, but 'href' and 'name' attributes are missing, then the span/text is not imported from the HTML document. Workaround: preprocess the HTML and add the 'href' attribute to all <a> elements. Steps to reproduce: 1. Import the following HTML: <html> <body> <a target="_blank">Some text</a> </body> </html> Expected: The hyperlink "Some text" is imported in the document. Actual: The span "Some text" is not imported.
A reference in DocumentFragment to RadDocument (CopySource property) can cause a memory after copy-paste between RadDocument.
Workaround:
public static bool ReleaseClipboardExReferences(
RadDocument document)
{
dynamic clipboardEx = new DynamicProxyObject(typeof(ClipboardEx));
if (clipboardEx.documentClipboardData?.CopySource is DynamicProxyObject copySource
&& object.ReferenceEquals(copySource.Instance, document))
{
clipboardEx.documentClipboardData = null;
return true;
}
if (clipboardEx.CopiedDocumentFragment?.Fragment?.CopySource is DynamicProxyObject fragmentCopySource
&& object.ReferenceEquals(fragmentCopySource.Instance, document))
{
clipboardEx.CopiedDocumentFragment = null;
return true;
}
return false;
}
The width of the image is inherited from the table element it is in when it doesn't have a specific width set to it. Sample HTML reproducing the problem is: <html> <body> <table style="width: 700px;"> <tbody> <tr> <td> <img src="" /> </td> </tr> </tbody> </table> </body> </html> Instead, the real size of the image should be used. Workaround: Subscribe to LoadImageFromUri and set size to the image. settings.LoadImageFromUrl += (s, arg) => { if (arg.Url != null) { string extension = Path.GetExtension(arg.Url); Uri uri = new Uri(arg.Url, UriKind.RelativeOrAbsolute); System.Net.WebClient oWebClient = new System.Net.WebClient(); using (MemoryStream stream = new MemoryStream()) { oWebClient.OpenRead(uri).CopyTo(stream); arg.ImageElement.Init(stream, extension); arg.ImageElement.Size = new Size(164, 80); e.Handled = true; } } };
RichTextBox interprets the div tag by adding a new line upon its closing. However, when the content of the div tag is a br tag, the whole combination should be treated as one new line.